Skip to main content
Glama

get_paper

Retrieve scientific paper details from WormBase, including authors, abstract, and associated genes, using a paper or PubMed ID.

Instructions

Get information about a scientific paper/publication including authors, abstract, and associated genes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesPaper identifier - WormBase paper ID (e.g., 'WBPaper00000001') or PubMed ID

Implementation Reference

  • src/index.ts:270-289 (registration)
    Registers the 'get_paper' MCP tool with name, description, input schema (id: string), and an inline async handler that fetches paper data using WormBaseClient.getEntity and returns JSON-formatted response or error.
    server.tool( "get_paper", "Get information about a scientific paper/publication including authors, abstract, and associated genes.", { id: z.string().describe("Paper identifier - WormBase paper ID (e.g., 'WBPaper00000001') or PubMed ID"), }, async ({ id }) => { try { const data = await client.getEntity("paper", id, ["overview", "referenced_genes"]); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }], }; } catch (error) { return { content: [{ type: "text", text: `Error fetching paper: ${error}` }], isError: true, }; } } );
  • Inline handler function for the get_paper tool. Calls WormBaseClient.getEntity for type 'paper' with widgets ['overview', 'referenced_genes'], serializes to JSON text response.
    async ({ id }) => { try { const data = await client.getEntity("paper", id, ["overview", "referenced_genes"]); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }], }; } catch (error) { return { content: [{ type: "text", text: `Error fetching paper: ${error}` }], isError: true, }; } }
  • Zod input schema for get_paper tool: requires 'id' string parameter (WormBase paper ID or PubMed ID).
    { id: z.string().describe("Paper identifier - WormBase paper ID (e.g., 'WBPaper00000001') or PubMed ID"), },
  • WormBaseClient.getEntity generic helper method implementing the core API fetch logic for any WormBase entity (including 'paper'), retrieving specified widgets from REST API and cleaning the 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; }

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