Skip to main content
Glama

get_class_info

Retrieve detailed information about a specific ontology class, including attributes like preferred labels, definitions, and hierarchical relationships, using the BioOntology MCP Server.

Instructions

Get detailed information about a specific ontology class

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
class_idYesClass ID/URI (URL-encoded if necessary)
includeNoComma-separated attributes to include (e.g., prefLabel,definition,parents,children)
ontologyYesOntology acronym

Implementation Reference

  • The main handler function that executes the get_class_info tool logic. Validates args, makes API call to BioOntology.org for class info, returns JSON response or error.
    private async handleGetClassInfo(args: any) { if (!isValidGetClassInfoArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid class info arguments'); } try { const params: any = { apikey: this.apiKey, }; if (args.include) params.include = args.include; const response = await this.apiClient.get(`/ontologies/${args.ontology}/classes/${encodeURIComponent(args.class_id)}`, { params }); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error: any) { return { content: [ { type: 'text', text: `Error fetching class info: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; } }
  • Type guard function for validating input arguments to get_class_info tool.
    const isValidGetClassInfoArgs = ( args: any ): args is { ontology: string; class_id: string; include?: string } => { return ( typeof args === 'object' && args !== null && typeof args.ontology === 'string' && args.ontology.length > 0 && typeof args.class_id === 'string' && args.class_id.length > 0 && (args.include === undefined || typeof args.include === 'string') ); };
  • src/index.ts:656-667 (registration)
    Tool registration in the ListToolsRequestSchema handler, including name, description, and input schema definition.
    name: 'get_class_info', description: 'Get detailed information about a specific ontology class', inputSchema: { type: 'object', properties: { ontology: { type: 'string', description: 'Ontology acronym' }, class_id: { type: 'string', description: 'Class ID/URI (URL-encoded if necessary)' }, include: { type: 'string', description: 'Comma-separated attributes to include (e.g., prefLabel,definition,parents,children)' }, }, required: ['ontology', 'class_id'], }, },
  • src/index.ts:717-718 (registration)
    Dispatch case in the CallToolRequestSchema switch statement that routes to the handler.
    case 'get_class_info': return this.handleGetClassInfo(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/BioOntology-MCP-Server'

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