Skip to main content
Glama

search_by_localization

Find proteins by their subcellular location such as nucleus or mitochondria using the UniProt MCP Server. Filter results by organism and control output size.

Instructions

Find proteins by subcellular localization

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
localizationYesSubcellular localization (e.g., nucleus, mitochondria)
organismNoOrganism name or taxonomy ID to filter results
sizeNoNumber of results to return (1-500, default: 25)

Implementation Reference

  • The handler function executing the tool: validates input, constructs UniProt search query using subcellular location (cc_subcellular_location), fetches results via API, returns JSON response or error.
    private async handleSearchByLocalization(args: any) {
      if (!isValidLocalizationSearchArgs(args)) {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid localization search arguments');
      }
    
      try {
        let query = `reviewed:true AND cc_subcellular_location:"${args.localization}"`;
    
        if (args.organism) {
          query += ` AND organism_name:"${args.organism}"`;
        }
    
        const response = await this.apiClient.get('/uniprotkb/search', {
          params: {
            query: query,
            format: 'json',
            size: args.size || 25,
          },
        });
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(response.data, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error searching by localization: ${error instanceof Error ? error.message : 'Unknown error'}`,
            },
          ],
          isError: true,
        };
      }
    }
  • src/index.ts:595-606 (registration)
    Tool registration in ListToolsRequestSchema handler, defining name, description, and input schema.
      name: 'search_by_localization',
      description: 'Find proteins by subcellular localization',
      inputSchema: {
        type: 'object',
        properties: {
          localization: { type: 'string', description: 'Subcellular localization (e.g., nucleus, mitochondria)' },
          organism: { type: 'string', description: 'Organism name or taxonomy ID to filter results' },
          size: { type: 'number', description: 'Number of results to return (1-500, default: 25)', minimum: 1, maximum: 500 },
        },
        required: ['localization'],
      },
    },
  • Helper function validating input arguments for the search_by_localization tool.
    const isValidLocalizationSearchArgs = (
      args: any
    ): args is { localization: string; organism?: string; size?: number } => {
      return (
        typeof args === 'object' &&
        args !== null &&
        typeof args.localization === 'string' &&
        args.localization.length > 0 &&
        (args.organism === undefined || typeof args.organism === 'string') &&
        (args.size === undefined || (typeof args.size === 'number' && args.size > 0 && args.size <= 500))
      );
    };
  • src/index.ts:763-764 (registration)
    Dispatch case in CallToolRequestSchema switch statement that routes calls to the handler.
    case 'search_by_localization':
      return this.handleSearchByLocalization(args);
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic function. It doesn't disclose behavioral traits such as whether this is a read-only operation, performance characteristics, rate limits, or what the output format looks like (no output schema exists).

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 with zero wasted words. It's front-loaded with the core purpose and appropriately sized for a simple search tool.

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?

For a search tool with 3 parameters and 100% schema coverage but no output schema, the description is minimally adequate. It states what the tool does but lacks context about output format, result limitations, or how it differs from sibling tools, leaving gaps for an AI agent.

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 already documents all three parameters thoroughly. The description doesn't add any meaning beyond what the schema provides, such as examples of localization values beyond 'nucleus, mitochondria' or organism naming conventions.

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 ('Find') and resource ('proteins') with a specific criterion ('by subcellular localization'). It distinguishes from siblings like 'search_by_function' or 'search_by_taxonomy' by focusing on localization, but doesn't explicitly contrast with 'search_proteins' which might be more general.

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?

No guidance is provided on when to use this tool versus alternatives like 'search_proteins' or 'search_by_function'. The description implies usage for localization-based queries but doesn't specify exclusions or prerequisites.

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/UniProt-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server