get_doc_page
Retrieve documentation pages from Pocket Network's API documentation to access blockchain data specifications and integration guides.
Instructions
Retrieve a documentation page from api.pocket.network/docs
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)Executes the get_doc_page tool by calling docsManager.getDocPage and formatting the response as MCP 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)Defines the input schema for the get_doc_page tool, requiring a 'path' string.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)Registers the get_doc_page tool in the tools array 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 implementation of fetching a documentation page from the configured base URL, extracting title, and returning DocPage.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; } }