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
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Gene identifier |
Implementation Reference
- src/index.ts:208-219 (handler)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, }; }
- src/client.ts:169-173 (handler)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); }
- src/index.ts:205-207 (schema)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, }; } } );