Skip to main content
Glama

get_class_info

Retrieve detailed information about biological ontology classes, including definitions, relationships, and attributes, to support ontology exploration and analysis.

Instructions

Get detailed information about a specific ontology class

Input Schema

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

Implementation Reference

  • The handler function for the 'get_class_info' tool. Validates arguments, makes an API request to BioOntology.org for the specified ontology class, and returns the 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 that validates the input arguments for the get_class_info tool, ensuring ontology and class_id are non-empty strings, and include is optional string.
    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:655-667 (registration)
    Tool registration in the ListToolsRequestSchema handler, defining the name, description, and detailed inputSchema for get_class_info.
    {
      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 calls to the get_class_info handler.
    case 'get_class_info':
      return this.handleGetClassInfo(args);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states it 'gets' information (implying a read operation) but doesn't specify whether this requires authentication, has rate limits, returns paginated results, or what happens with invalid inputs. The description adds minimal behavioral context beyond the implied read operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized for a straightforward retrieval tool and front-loads the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read operation with 100% schema coverage but no output schema or annotations, the description is minimally adequate. It clarifies the scope ('specific ontology class') but doesn't address behavioral aspects like error handling or response format. Given the lack of output schema, more detail about return values would be beneficial but isn't critical for basic functionality.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description doesn't add any parameter-specific semantics beyond what's in the schema (e.g., it doesn't explain format examples for 'include' beyond the schema's description). Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('detailed information about a specific ontology class'), making the purpose unambiguous. It distinguishes from siblings like 'get_ontology_info' (which likely provides ontology-level details) and 'search_terms' (which searches rather than retrieves specific class data). However, it doesn't explicitly contrast with these siblings in the description text itself.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose 'get_class_info' over 'get_ontology_info' (for ontology-level data) or 'search_terms' (for finding classes), nor does it specify prerequisites or contextual constraints for usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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