Skip to main content
Glama

get_go_term

Retrieve detailed information for a specific Gene Ontology (GO) term using its identifier to support ontology-based analysis, gene annotation, and functional enrichment studies.

Instructions

Get detailed information for a specific GO term

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesGO term identifier (e.g., GO:0008150)

Implementation Reference

  • Executes the get_go_term tool: validates input, fetches detailed GO term data from QuickGO API, handles errors, and formats comprehensive term information including definition, namespace, synonyms, and links.
    private async handleGetGoTerm(args: any) { if (!isValidTermArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'GO term ID is required'); } try { const termId = this.normalizeGoId(args.id); const response = await this.quickGoClient.get(`/ontology/go/terms/${termId}`); const termInfo = response.data.results?.[0]; if (!termInfo) { return { content: [ { type: 'text', text: JSON.stringify({ error: `GO term not found: ${termId}`, suggestion: 'Check the GO ID format (e.g., GO:0008150) or search for the term first' }, null, 2), }, ], isError: true, }; } const detailedTerm = { id: termInfo.id, name: termInfo.name, definition: { text: termInfo.definition?.text || 'No definition available', references: termInfo.definition?.xrefs || [] }, namespace: termInfo.aspect === 'F' ? 'molecular_function' : termInfo.aspect === 'P' ? 'biological_process' : 'cellular_component', obsolete: termInfo.isObsolete || false, replaced_by: termInfo.replacedBy || [], consider: termInfo.consider || [], synonyms: termInfo.synonyms || [], xrefs: termInfo.xrefs || [], url: `https://www.ebi.ac.uk/QuickGO/term/${termInfo.id}`, amigo_url: `http://amigo.geneontology.org/amigo/term/${termInfo.id}` }; return { content: [ { type: 'text', text: JSON.stringify(detailedTerm, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error fetching GO term: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; } }
  • src/index.ts:304-313 (registration)
    Registers the get_go_term tool with the MCP server in the ListToolsRequestHandler, defining its name, description, and input schema.
    name: 'get_go_term', description: 'Get detailed information for a specific GO term', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'GO term identifier (e.g., GO:0008150)' }, }, required: ['id'], }, },
  • Type guard function for validating input arguments to the get_go_term tool, ensuring 'id' is a non-empty string.
    const isValidTermArgs = (args: any): args is { id: string } => { return ( typeof args === 'object' && args !== null && typeof args.id === 'string' && args.id.length > 0 ); };
  • Utility function to normalize GO term IDs by adding 'GO:' prefix if missing or ensuring proper 7-digit format.
    private normalizeGoId(id: string): string { if (id.startsWith('GO:')) { return id; } if (/^\d{7}$/.test(id)) { return `GO:${id}`; } return id; }
  • src/index.ts:345-346 (registration)
    Dispatch case in CallToolRequestHandler that routes get_go_term calls to the handler function.
    case 'get_go_term': return this.handleGetGoTerm(args);

Other Tools

Related 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/Augmented-Nature/GeneOntology-MCP-Server'

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