Adding a New Tool
- Create tool registration function in appropriate module under
src/tools/ - Name the tool following the
pinmeto_{action}_{network}_{resource}pattern (see AGENTS.md) - Define Zod schema for input validation
- Add
response_format: ResponseFormatSchemato input schema - Define or reuse output schema from
src/schemas/output.ts - Implement handler using
server.makePinMeToRequest()orserver.makePaginatedPinMeToRequest() - Use
formatContent()helper to format response based onresponse_format - Return both
content(text) andstructuredContent(typed data) from handler - For insights tools, use
aggregateInsights()andfinalizeInsights()helpers - Add appropriate tool annotations —
readOnlyHint: truefor read-only tools, which is every tool currently in this server - Register tool in
createMcpServer()function insrc/mcp_server.ts
Follow the patterns in the existing tool modules rather than inventing new shapes — read a neighbouring tool in the same directory first.