Skip to main content
Glama

get_document_content

Retrieve full patent documents with chemical annotations using document IDs to access detailed chemical patent information from the SureChEMBL database.

Instructions

Get complete patent document content with chemical annotations by document ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
document_idYesPatent document ID (e.g., WO-2020096695-A1)

Implementation Reference

  • The handler function that validates input arguments, fetches patent document contents from the SureChEMBL API, and returns the content as formatted JSON.
    private async handleGetDocumentContent(args: any) { if (!isValidDocumentArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid document arguments'); } try { const response = await this.apiClient.get(`/document/${args.document_id}/contents`); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { throw new McpError( ErrorCode.InternalError, `Failed to get document content: ${error instanceof Error ? error.message : 'Unknown error'}` ); } }
  • src/index.ts:353-363 (registration)
    Registers the tool in the list returned by ListToolsRequest, including name, description, and input schema definition.
    { name: 'get_document_content', description: 'Get complete patent document content with chemical annotations by document ID', inputSchema: { type: 'object', properties: { document_id: { type: 'string', description: 'Patent document ID (e.g., WO-2020096695-A1)' }, }, required: ['document_id'], }, },
  • Defines the input schema for the tool: object with required 'document_id' string property.
    inputSchema: { type: 'object', properties: { document_id: { type: 'string', description: 'Patent document ID (e.g., WO-2020096695-A1)' }, }, required: ['document_id'], },
  • Helper function for validating the tool's input arguments, checking for valid 'document_id' and optional 'include_annotations'.
    const isValidDocumentArgs = ( args: any ): args is { document_id: string; include_annotations?: boolean } => { return ( typeof args === 'object' && args !== null && typeof args.document_id === 'string' && args.document_id.length > 0 && (args.include_annotations === undefined || typeof args.include_annotations === 'boolean') ); };
  • Switch case in the main CallToolRequest handler that routes get_document_content calls to the specific handler function.
    case 'get_document_content': return await this.handleGetDocumentContent(args);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Augmented-Nature/SureChEMBL-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server