Skip to content

Commit ca98c62

Browse files
committed
fix: address review comments - add JSDoc, null test, and clarify default behavior
1 parent 952ead5 commit ca98c62

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/core/prompts/tools/__tests__/fetch-instructions.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,14 @@ describe("getFetchInstructionsDescription", () => {
4040
expect(description).toContain("<fetch_instructions>")
4141
expect(description).toContain("</fetch_instructions>")
4242
})
43+
44+
it("should handle null value consistently (treat as default/undefined)", () => {
45+
const description = getFetchInstructionsDescription(null as any)
46+
47+
// Should behave the same as undefined (default to true)
48+
expect(description).toContain("create_mcp_server")
49+
expect(description).toContain("create_mode")
50+
expect(description).toContain("Example: Requesting instructions to create an MCP Server")
51+
expect(description).toContain("<task>create_mcp_server</task>")
52+
})
4353
})

src/core/prompts/tools/fetch-instructions.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Generates the fetch_instructions tool description.
3+
* @param enableMcpServerCreation - Whether to include MCP server creation task.
4+
* Defaults to true when undefined.
5+
*/
16
export function getFetchInstructionsDescription(enableMcpServerCreation?: boolean): string {
27
const tasks =
38
enableMcpServerCreation !== false

0 commit comments

Comments
 (0)