Skip to main content
Glama
Augmented-Nature

SureChEMBL MCP Server

get_patent_family

Retrieve related patents and family connections for a specified patent ID from the SureChEMBL chemical patent database.

Instructions

Get patent family members and relationships for a patent

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patent_idYesPatent ID to find family members for

Implementation Reference

  • The main handler function that validates the patent_id input and fetches patent family members from the SureChEMBL API endpoint `/document/{patent_id}/family/members`, returning the JSON response.
    private async handleGetPatentFamily(args: any) {
      if (!isValidIdArgs({ id: args.patent_id })) {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid patent ID');
      }
    
      try {
        const response = await this.apiClient.get(`/document/${args.patent_id}/family/members`);
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(response.data, null, 2),
            },
          ],
        };
      } catch (error) {
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to get patent family: ${error instanceof Error ? error.message : 'Unknown error'}`
        );
      }
    }
  • src/index.ts:364-374 (registration)
    Tool registration definition in the ListToolsRequestSchema handler, including name, description, and input schema requiring 'patent_id'.
    {
      name: 'get_patent_family',
      description: 'Get patent family members and relationships for a patent',
      inputSchema: {
        type: 'object',
        properties: {
          patent_id: { type: 'string', description: 'Patent ID to find family members for' },
        },
        required: ['patent_id'],
      },
    },
  • src/index.ts:548-549 (registration)
    Dispatch case in the CallToolRequestSchema handler that routes to the handleGetPatentFamily method.
    case 'get_patent_family':
      return await this.handleGetPatentFamily(args);
  • Helper validation function used in the handler to validate the presence and format of the patent_id argument.
    const isValidIdArgs = (
      args: any
    ): args is { id: string } => {
      return (
        typeof args === 'object' &&
        args !== null &&
        typeof args.id === 'string' &&
        args.id.length > 0
      );
    };

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