Skip to main content
Glama
Augmented-Nature

SureChEMBL MCP Server

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);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves content with chemical annotations but does not describe response format, error conditions, rate limits, or authentication needs. For a read operation with no annotation coverage, this leaves significant gaps in understanding tool behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It is front-loaded with the core purpose and includes all necessary elements without redundancy, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete for a tool that retrieves complex content. It does not explain what 'complete patent document content' includes, the format of chemical annotations, or any limitations, leaving the agent with insufficient context for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents the single parameter. The description adds minimal value beyond the schema by implying the document_id is for patent documents and mentioning chemical annotations, but does not provide additional syntax or format details. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get complete patent document content'), the resource ('patent document'), and key features ('with chemical annotations by document ID'). It distinguishes from siblings like get_patent_family or get_patent_statistics by focusing on full content retrieval with annotations rather than metadata or statistics.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites, exclusions, or compare to siblings like search_patents or get_patent_family, leaving the agent to infer usage context independently.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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