search_by_patent_number
Find patents in the SureChEMBL chemical patent database using specific patent or publication numbers 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 main handler function that validates the input patent_number and retrieves the patent document contents by making an API call to the SureChEMBL endpoint `/document/{patent_number}/contents`. Returns formatted JSON response or throws MCP errors.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)Registers the 'search_by_patent_number' tool with the MCP server, providing the tool name, description, and input schema for validation.{ 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 (handler)Dispatch case in the central tool request handler switch statement that routes calls to the specific handleSearchByPatentNumber method.case 'search_by_patent_number': return await this.handleSearchByPatentNumber(args);