get_doc_page
Retrieve documentation pages from docs.grove.city to access blockchain API guides, network specifications, and developer resources for cross-chain data queries.
Instructions
Retrieve a documentation page from docs.grove.city
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The path to the documentation page (e.g., "/api/overview") |
Implementation Reference
- src/handlers/docs-handlers.ts:81-105 (handler)Handler logic for executing the 'get_doc_page' tool call. Extracts path argument, fetches doc page via docsManager, handles error if not found, and returns JSON stringified content.case 'get_doc_page': { const path = args?.path as string; const docPage = await docsManager.getDocPage(path); if (!docPage) { return { content: [ { type: 'text', text: `Documentation page not found: ${path}`, }, ], isError: true, }; } return { content: [ { type: 'text', text: JSON.stringify(docPage, null, 2), }, ], }; }
- src/handlers/docs-handlers.ts:18-27 (schema)Input schema definition for the 'get_doc_page' tool, specifying a required 'path' string parameter.inputSchema: { type: 'object', properties: { path: { type: 'string', description: 'The path to the documentation page (e.g., "/api/overview")', }, }, required: ['path'], },
- src/handlers/docs-handlers.ts:15-28 (registration)Tool registration object for 'get_doc_page', including name, description, and input schema, returned by registerDocsHandlers.{ name: 'get_doc_page', description: 'Retrieve a documentation page from api.pocket.network/docs', inputSchema: { type: 'object', properties: { path: { type: 'string', description: 'The path to the documentation page (e.g., "/api/overview")', }, }, required: ['path'], }, },
- src/services/docs-manager.ts:16-37 (helper)Core helper method implementing the documentation page fetch: constructs URL, fetches HTML, extracts title using extractTitle, and returns DocPage or null.async getDocPage(path: string): Promise<DocPage | null> { try { const url = `${this.baseUrl}${path.startsWith('/') ? path : '/' + path}`; const response = await fetch(url); if (!response.ok) { return null; } const content = await response.text(); return { title: this.extractTitle(content), content, url, lastUpdated: response.headers.get('last-modified') || undefined }; } catch (error) { console.error('Error fetching doc page:', error); return null; } }