Skip to main content
Glama

get_expression

Retrieve gene expression patterns including tissue/cell expression, life stage expression, and expression images from WormBase database for C. elegans genomics research.

Instructions

Get expression pattern information for a gene including tissue/cell expression, life stage expression, and expression images.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesGene identifier

Implementation Reference

  • MCP tool handler that receives the gene ID, calls client.getExpression(id), formats the result as JSON text content, and handles errors.
    async ({ id }) => { try { const data = await client.getExpression(id); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }], }; } catch (error) { return { content: [{ type: "text", text: `Error fetching expression: ${error}` }], isError: true, }; }
  • Core implementation fetching expression data from WormBase REST API endpoint /rest/widget/gene/{id}/expression and processing with cleanWidgetData.
    async getExpression(id: string): Promise<Record<string, unknown>> { const url = `${this.baseUrl}/rest/widget/gene/${encodeURIComponent(id)}/expression`; const data = await this.fetch<any>(url); return this.cleanWidgetData(data); }
  • Input schema defining the required 'id' parameter as a string (gene identifier).
    { id: z.string().describe("Gene identifier"), },
  • src/index.ts:202-221 (registration)
    Full registration of the 'get_expression' tool using McpServer.tool, including name, description, input schema, and handler function.
    server.tool( "get_expression", "Get expression pattern information for a gene including tissue/cell expression, life stage expression, and expression images.", { id: z.string().describe("Gene identifier"), }, async ({ id }) => { try { const data = await client.getExpression(id); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }], }; } catch (error) { return { content: [{ type: "text", text: `Error fetching expression: ${error}` }], isError: true, }; } } );

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