get_expression
Retrieve gene expression patterns including tissue/cell localization, life stage timing, and associated images from the WormBase database for C. elegans research.
Instructions
Get expression pattern information for a gene including tissue/cell expression, life stage expression, and expression images.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Gene identifier |
Implementation Reference
- src/client.ts:169-173 (handler)The main handler function that fetches gene expression data from the WormBase API endpoint and processes it using the cleanWidgetData helper.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); }
- src/index.ts:202-221 (registration)MCP server tool registration for 'get_expression', including name, description, input schema, and handler that calls the client method.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, }; } } );
- src/index.ts:205-207 (schema)Zod input schema for the get_expression tool, requiring a gene 'id' parameter.{ id: z.string().describe("Gene identifier"), },