search_by_patent_number
Find patents in the SureChEMBL chemical patent database by entering a specific patent or publication number to retrieve detailed information.
Instructions
Search for patents by specific patent numbers or publication numbers
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| patent_number | Yes | Patent or publication number |
Implementation Reference
- src/index.ts:674-699 (handler)The handler function that implements the core logic for the 'search_by_patent_number' tool. It validates the input patent number, queries the SureChEMBL API endpoint `/document/{patent_number}/contents`, and returns the patent document data or throws an error if not found.private async handleSearchByPatentNumber(args: any) { if (!args || typeof args.patent_number !== 'string') { throw new McpError(ErrorCode.InvalidParams, 'Invalid patent number'); } try { // Try to get document content directly const response = await this.apiClient.get(`/document/${args.patent_number}/contents`); return { content: [ { type: 'text', text: JSON.stringify({ patent_number: args.patent_number, document: response.data }, null, 2), }, ], }; } catch (error) { throw new McpError( ErrorCode.InternalError, `Failed to find patent: ${error instanceof Error ? error.message : 'Unknown error'}` ); } }
- src/index.ts:375-385 (registration)The tool registration entry in the ListToolsRequestSchema handler, defining the tool name, description, and input schema for 'search_by_patent_number'.{ name: 'search_by_patent_number', description: 'Search for patents by specific patent numbers or publication numbers', inputSchema: { type: 'object', properties: { patent_number: { type: 'string', description: 'Patent or publication number' }, }, required: ['patent_number'], }, },
- src/index.ts:550-551 (registration)The dispatch case in the CallToolRequestSchema handler that routes calls to the 'search_by_patent_number' tool to its handler function.case 'search_by_patent_number': return await this.handleSearchByPatentNumber(args);
- src/index.ts:378-384 (schema)The input schema definition for the 'search_by_patent_number' tool, specifying a required 'patent_number' string parameter.inputSchema: { type: 'object', properties: { patent_number: { type: 'string', description: 'Patent or publication number' }, }, required: ['patent_number'], },