Skip to main content
Glama
WormBase

WormBase MCP Server

Official
by WormBase

get_protein

Retrieve detailed protein information including sequence, domains, motifs, and structure from the WormBase database for C. elegans research.

Instructions

Get detailed information about a protein including sequence, domains, motifs, and structure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesProtein identifier - WormBase protein ID
widgetsNoSpecific widgets to fetch: overview, sequences, motif_details, external_links, references

Implementation Reference

  • src/index.ts:64-84 (registration)
    MCP server.tool registration for 'get_protein', including tool description, Zod input schema for protein ID and optional widgets, and inline async handler that fetches data via WormBaseClient and returns JSON-formatted response or error.
    server.tool(
      "get_protein",
      "Get detailed information about a protein including sequence, domains, motifs, and structure.",
      {
        id: z.string().describe("Protein identifier - WormBase protein ID"),
        widgets: z.array(z.string()).optional().describe("Specific widgets to fetch: overview, sequences, motif_details, external_links, references"),
      },
      async ({ id, widgets }) => {
        try {
          const data = await client.getEntity("protein", id, widgets);
          return {
            content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
          };
        } catch (error) {
          return {
            content: [{ type: "text", text: `Error fetching protein: ${error}` }],
            isError: true,
          };
        }
      }
    );
  • Inline handler function executing the core logic of the get_protein tool: retrieves protein entity data using client.getEntity with type 'protein', stringifies to JSON, handles errors.
    async ({ id, widgets }) => {
      try {
        const data = await client.getEntity("protein", id, widgets);
        return {
          content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
        };
      } catch (error) {
        return {
          content: [{ type: "text", text: `Error fetching protein: ${error}` }],
          isError: true,
        };
      }
    }
  • Zod schema for get_protein tool inputs: required 'id' string (WormBase protein ID), optional 'widgets' array specifying data sections like sequences, motifs.
    {
      id: z.string().describe("Protein identifier - WormBase protein ID"),
      widgets: z.array(z.string()).optional().describe("Specific widgets to fetch: overview, sequences, motif_details, external_links, references"),
    },
  • WormBaseClient.getEntity helper method called by get_protein handler; fetches specified widgets from WormBase REST API for any entity type (hardcoded 'protein' in handler), cleans data.
    async getEntity(
      type: EntityType,
      id: string,
      widgets?: string[]
    ): Promise<Record<string, unknown>> {
      const defaultWidgets = ["overview"];
      const requestedWidgets = widgets || defaultWidgets;
    
      const result: Record<string, unknown> = { id, type };
    
      for (const widget of requestedWidgets) {
        try {
          const url = `${this.baseUrl}/rest/widget/${type}/${encodeURIComponent(id)}/${widget}`;
          const data = await this.fetch<any>(url);
          result[widget] = this.cleanWidgetData(data);
        } catch (error) {
          result[widget] = { error: `Failed to fetch ${widget}` };
        }
      }
    
      return result;
    }
  • TypeScript const array defining available widgets specifically for protein entities, referenced in the tool's schema description.
    export const PROTEIN_WIDGETS = [
      ...COMMON_WIDGETS,
      "sequences",
      "motif_details",
      "homology",
      "blast_details",
    ] as const;
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions what information is retrieved but lacks behavioral details such as authentication requirements, rate limits, error handling, or response format. For a read operation with no annotation coverage, this leaves significant gaps in understanding how the tool behaves.

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 and lists key details without waste. Every word earns its place by specifying the action, resource, and examples of returned information, making it highly concise and well-structured.

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 (2 parameters, no output schema, no annotations), the description is minimally adequate. It covers the purpose and output types but lacks behavioral context and usage guidelines. Without annotations or output schema, more detail on response structure or operational constraints would improve completeness, but it's not entirely incomplete.

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?

The schema description coverage is 100%, so the schema already documents both parameters ('id' and 'widgets') thoroughly. The description adds no additional parameter semantics beyond implying that 'widgets' controls which detailed information (e.g., sequence, domains) is fetched, but this is redundant with the schema. Baseline 3 is appropriate as the schema does the heavy lifting.

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 tool's purpose: 'Get detailed information about a protein including sequence, domains, motifs, and structure.' It specifies the verb ('Get') and resource ('protein') with concrete examples of the information returned. However, it doesn't explicitly differentiate from sibling tools like 'get_gene' or 'get_entity', which likely retrieve different biological entities.

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. It doesn't mention prerequisites, context for protein retrieval, or comparisons to sibling tools such as 'get_gene' for gene information or 'search' for broader queries. Usage is implied but not explicitly stated.

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/WormBase/wormbase-mcp'

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