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
| Name | Required | Description | Default |
|---|---|---|---|
| patent_id | Yes | Patent ID to find family members for |
Implementation Reference
- src/index.ts:651-672 (handler)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);
- src/index.ts:93-102 (helper)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 ); };