Skip to content

Commit 3240242

Browse files
chore(mcp-server): improve instructions
1 parent 0e6e60b commit 3240242

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

packages/mcp-server/src/docs-search-tool.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ export const metadata: Metadata = {
1313

1414
export const tool: Tool = {
1515
name: 'search_docs',
16-
description: 'Search for documentation for how to use the client to interact with the API.',
16+
description:
17+
'Search SDK documentation to find methods, parameters, and usage examples for interacting with the API. Use this before writing code when you need to discover the right approach.',
1718
inputSchema: {
1819
type: 'object',
1920
properties: {

packages/mcp-server/src/instructions.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,11 @@ async function fetchLatestInstructions(stainlessApiKey: string | undefined): Pro
5555
'Warning: failed to retrieve MCP server instructions. Proceeding with default instructions...',
5656
);
5757

58-
instructions = `
59-
This is the finch MCP server. You will use Code Mode to help the user perform
60-
actions. You can use search_docs tool to learn about how to take action with this server. Then,
61-
you will write TypeScript code using the execute tool take action. It is CRITICAL that you be
62-
thoughtful and deliberate when executing code. Always try to entirely solve the problem in code
63-
block: it can be as long as you need to get the job done!
64-
`;
58+
instructions =
59+
'\n This is the finch MCP server.\n\n Available tools:\n - search_docs: Search SDK documentation to find the right methods and parameters.\n - execute: Run TypeScript code against a pre-authenticated SDK client. Define an async run(client) function.\n\n Workflow:\n - If unsure about the API, call search_docs first.\n - Write complete solutions in a single execute call when possible. For large datasets, use API filters to narrow results or paginate within a single execute block.\n - If execute returns an error, read the error and fix your code rather than retrying the same approach.\n - Variables do not persist between execute calls. Return or log all data you need.\n - Individual HTTP requests to the API have a 30-second timeout. If a request times out, try a smaller query or add filters.\n - Code execution has a total timeout of approximately 5 minutes. If your code times out, simplify it or break it into smaller steps.\n ';
6560
}
6661

6762
instructions ??= ((await response.json()) as { instructions: string }).instructions;
68-
instructions = `
69-
If needed, you can get the current time by executing Date.now().
70-
71-
${instructions}
72-
`;
7363

7464
return instructions;
7565
}

0 commit comments

Comments
 (0)