Skip to content

Commit cf04d31

Browse files
authored
refactor(stack-mcp): rename search tool to search_dev_stack and tighten tool descriptions (#433)
1 parent e626300 commit cf04d31

4 files changed

Lines changed: 17 additions & 14 deletions

File tree

.changeset/developer-stack-mcp.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"stack-mcp": patch
3+
---
4+
5+
Rename the search tool from `search_docs` to `search_dev_stack`, and rewrite both tool descriptions.

apps/stack-mcp/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) s
66

77
The server exposes two read-only tools, one to discover what's available and one to search it:
88

9-
| Tool | Description |
10-
| ---------------- | ---------------------------------------------------------------------------------------------- |
11-
| `list_libraries` | List the documentation libraries this server can search (slug, name, source, description). |
12-
| `search_docs` | Search across the stack (or one `library`), returning cited doc chunks with their source URLs. |
9+
| Tool | Description |
10+
| ------------------ | ---------------------------------------------------------------------------------------------- |
11+
| `list_libraries` | List the documentation libraries this server can search (slug, name, source, description). |
12+
| `search_dev_stack` | Search across the stack (or one `library`), returning cited doc chunks with their source URLs. |
1313

1414
## 📚 Libraries
1515

@@ -36,7 +36,7 @@ The `/mcp` endpoint accepts a `libs` query param to scope the server to a subset
3636
https://stack.mcp.cloudflare.com/mcp?libs=cloudflare,hono,vite
3737
```
3838

39-
When scoped, `list_libraries` and `search_docs` (including its `library` enum) only expose the selected libraries, and cross-stack search is limited to them. Unknown slugs are ignored, and an empty or all-invalid `libs` falls back to the whole stack.
39+
When scoped, `list_libraries` and `search_dev_stack` (including its `library` enum) only expose the selected libraries, and cross-stack search is limited to them. Unknown slugs are ignored, and an empty or all-invalid `libs` falls back to the whole stack.
4040

4141
Scoping is read from the connection URL on every request, so it applies whether the client connects to `/mcp` or the `/sse` alias.
4242

apps/stack-mcp/src/stack-mcp.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ testStatelessMcpApp<Env>({
1111
handler: mcpHandler,
1212
env: env as unknown as Env,
1313
url: 'https://stack.mcp.cloudflare.com',
14-
expectedTools: ['list_libraries', 'search_docs'],
15-
requiredToolInputs: { search_docs: ['query'] },
14+
expectedTools: ['list_libraries', 'search_dev_stack'],
15+
requiredToolInputs: { search_dev_stack: ['query'] },
1616
})

apps/stack-mcp/src/tools/stack.tools.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ export function registerStackTools<Env extends RequiredEnv>(context: McpRegistra
5252
context.registerTool(
5353
'list_libraries',
5454
{
55-
description: `List the tools whose documentation this server can search (${names}), with each one's slug, name, source site, and a short description.
55+
description: `List the libraries search_dev_stack has docs for (${names}), each with its slug, name, source, and description.
5656
57-
Use it to check whether a tool is covered, or to get the exact \`library\` slug for search_docs. You do not need to call it first: searching without a \`library\` already covers the whole stack.`,
57+
Use it to check coverage or to get a \`library\` slug for search_dev_stack. You do not need to call it first: searching without a \`library\` already covers the whole stack.`,
5858
inputSchema: z.object({}),
5959
outputSchema: z.object({
6060
libraries: z.array(
@@ -85,13 +85,11 @@ Use it to check whether a tool is covered, or to get the exact \`library\` slug
8585
)
8686

8787
context.registerTool(
88-
'search_docs',
88+
'search_dev_stack',
8989
{
90-
description: `Search current documentation for the tools in this developer stack (${names}) and get back the most relevant excerpts, each with a source link.
90+
description: `Search current documentation for the tools you build with (${names}) and get relevant excerpts with source links.
9191
92-
Reach for this whenever you are answering a question about, or writing code that uses, any of these tools. They change often, so your built-in knowledge of their APIs, configuration, and defaults is frequently out of date. Retrieve the docs instead of relying on memory, and ground the code you generate in what you find.
93-
94-
Cite the returned source URLs in your answer. Searches the whole stack by default; set \`library\` to one slug (from list_libraries) to focus on a single tool.`,
92+
Whenever you are building or prototyping anything, start here: search to find the right tools for the job and their current usage, then build from what you find. Use even when you think you know the answer because your training data may not reflect recent changes. Prefer this over web search for library docs. Cite the source URLs. Omit \`library\` to search the whole stack, or set one slug to focus.`,
9593
inputSchema: z.object({
9694
query: StackSearchQueryParam,
9795
library: z

0 commit comments

Comments
 (0)