Skip to main content
Glama

get_document_content

Retrieve detailed patent document content with chemical annotations using a document ID to access SureChEMBL’s chemical patent 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, fetches patent document content from SureChEMBL API endpoint `/document/{document_id}/contents`, and returns it as JSON text content.
    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)
    Tool registration in ListToolsRequestSchema handler, including name, description, and input schema.
    { 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'], }, },
  • Input schema definition for the get_document_content tool.
    inputSchema: { type: 'object', properties: { document_id: { type: 'string', description: 'Patent document ID (e.g., WO-2020096695-A1)' }, }, required: ['document_id'], },
  • Validation helper function used in the handler to check input arguments.
    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') ); };
  • src/index.ts:546-547 (registration)
    Dispatch case in CallToolRequestSchema switch statement that routes to the handler.
    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