MCPcopy Index your code
hub / github.com/colbymchenry/codegraph / expectReadOnly

Function expectReadOnly

__tests__/mcp-tool-annotations.test.ts:27–35  ·  view source on GitHub ↗

Assert a single tool advertises the full read-only contract from #1018.

(tool: ToolDefinition)

Source from the content-addressed store, hash-verified

25
26/** Assert a single tool advertises the full read-only contract from #1018. */
27function expectReadOnly(tool: ToolDefinition): void {
28 expect(tool.annotations, `${tool.name} is missing annotations`).toBeDefined();
29 // The hint Cursor Ask mode (and other clients) gate on.
30 expect(tool.annotations!.readOnlyHint).toBe(true);
31 // The exact triplet the issue asks for, plus the honest closed-world hint.
32 expect(tool.annotations!.destructiveHint).toBe(false);
33 expect(tool.annotations!.idempotentHint).toBe(true);
34 expect(tool.annotations!.openWorldHint).toBe(false);
35}
36
37describe('Read-only annotations on the codegraph MCP tools (#1018)', () => {
38 const original = process.env[ENV];

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected