Skip to main content
Glama
Augmented-Nature

SureChEMBL MCP Server

search_patents

Search the SureChEMBL database for patents using text, keywords, or identifiers to find relevant chemical patent information.

Instructions

Search patents by text, keywords, or identifiers in SureChEMBL database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query (keywords, patent numbers, or text)
limitNoNumber of results to return (1-1000, default: 25)
offsetNoNumber of results to skip (default: 0)

Implementation Reference

  • The handler function that implements the core logic for the 'search_patents' tool. It validates input arguments, performs a chemical name search via the SureChEMBL API as a proxy for patent search, and formats the response.
    private async handleSearchPatents(args: any) {
      if (!isValidSearchArgs(args)) {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid search arguments');
      }
    
      try {
        // SureChEMBL doesn't have a direct patent search endpoint, so we'll search chemicals and return patent context
        const response = await this.apiClient.get(`/chemical/name/${encodeURIComponent(args.query)}`);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                query: args.query,
                message: 'Patent search via chemical name lookup',
                results: response.data
              }, null, 2),
            },
          ],
        };
      } catch (error) {
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to search patents: ${error instanceof Error ? error.message : 'Unknown error'}`
        );
      }
    }
  • The JSON schema defining the input parameters for the 'search_patents' tool, including query (required), limit, and offset.
    inputSchema: {
      type: 'object',
      properties: {
        query: { type: 'string', description: 'Search query (keywords, patent numbers, or text)' },
        limit: { type: 'number', description: 'Number of results to return (1-1000, default: 25)', minimum: 1, maximum: 1000 },
        offset: { type: 'number', description: 'Number of results to skip (default: 0)', minimum: 0 },
      },
      required: ['query'],
    },
  • src/index.ts:544-545 (registration)
    The switch case in the CallToolRequestSchema handler that registers and dispatches calls to the 'search_patents' handler function.
    case 'search_patents':
      return await this.handleSearchPatents(args);
  • src/index.ts:340-352 (registration)
    The tool registration entry in the ListToolsRequestSchema response, defining name, description, and schema for 'search_patents'.
    {
      name: 'search_patents',
      description: 'Search patents by text, keywords, or identifiers in SureChEMBL database',
      inputSchema: {
        type: 'object',
        properties: {
          query: { type: 'string', description: 'Search query (keywords, patent numbers, or text)' },
          limit: { type: 'number', description: 'Number of results to return (1-1000, default: 25)', minimum: 1, maximum: 1000 },
          offset: { type: 'number', description: 'Number of results to skip (default: 0)', minimum: 0 },
        },
        required: ['query'],
      },
    },
  • Helper function for validating the input arguments specifically for the search_patents tool.
    const isValidSearchArgs = (
      args: any
    ): args is { query: string; limit?: number; offset?: number } => {
      return (
        typeof args === 'object' &&
        args !== null &&
        typeof args.query === 'string' &&
        args.query.length > 0 &&
        (args.limit === undefined || (typeof args.limit === 'number' && args.limit > 0 && args.limit <= 1000)) &&
        (args.offset === undefined || (typeof args.offset === 'number' && args.offset >= 0))
      );
    };
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the search functionality but lacks details on permissions, rate limits, response format, or error handling. For a search tool with zero annotation coverage, this leaves significant gaps in understanding its operational 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 that front-loads the core purpose without unnecessary words. Every part ('Search patents by text, keywords, or identifiers in SureChEMBL database') contributes directly to understanding the tool's function.

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

Completeness3/5

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

Given the tool's moderate complexity (search with three parameters), no annotations, and no output schema, the description is minimally adequate. It covers the basic purpose but lacks details on behavior, usage context, and output, which are needed for a more complete understanding. It meets the minimum viable threshold but has clear gaps.

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 three parameters (query, limit, offset). The description adds minimal value by implying the query can include 'text, keywords, or identifiers', but this doesn't go beyond the schema's description of 'Search query (keywords, patent numbers, or text)'. Baseline 3 is appropriate when the schema handles most documentation.

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

Purpose4/5

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

The description clearly states the action ('Search patents') and target resource ('patents in SureChEMBL database'), with the method ('by text, keywords, or identifiers') providing specific context. However, it doesn't explicitly differentiate from sibling tools like 'search_by_patent_number' or 'search_chemicals_by_name', which reduces it from a perfect score.

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 like 'search_by_patent_number' or 'search_chemicals_by_name'. It mentions the database (SureChEMBL) but doesn't specify use cases, exclusions, or prerequisites, leaving the agent without contextual direction.

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