Skip to main content
Glama
seandavi

OLS MCP Server

by seandavi

get_term_info

Retrieve detailed information about biological and medical ontology terms from the Ontology Lookup Service to support accurate research and analysis.

Instructions

Get detailed information about a specific term.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The primary handler function for the 'get_term_info' MCP tool. Decorated with @mcp.tool() for registration. It queries the OLS API /api/terms endpoint with the provided term ID, extracts the first term from the embedded response, validates it against the DetailedTermInfo Pydantic model, and returns the validated object or an error message.
    @mcp.tool()
    async def get_term_info(
        id: Annotated[
            str, 
            ("Can be the IRI (Example : http://purl.obolibrary.org/obo/DUO_0000017)"
             ", short form (Example : DUO_0000017), or obo ID (Example: DUO:0000017) of the term")
        ],
    ) -> DetailedTermInfo | str:
        """Get detailed information about a specific term."""
        
        url = f"{OLS_BASE_URL}/api/terms"
        
        try:
            response = await client.get(url, params={"id": id})
            response.raise_for_status()
            data = response.json()
            embedded = data.get("_embedded", {})
            if "terms" in embedded:
                terms = embedded["terms"]
                return DetailedTermInfo.model_validate(terms[0])
            return f"Term with ID '{id}' not found in OLS."
            
        except httpx.HTTPError as e:
            return f"Error getting term info: {str(e)}"
  • Pydantic model used for output validation in the get_term_info tool. Extends TermInfo with additional fields for description and synonyms.
    class DetailedTermInfo(TermInfo):
        description: Optional[list[str]] = Field(None, description="Definition of the term")
        synonyms: Optional[list[str]] = Field(None, description="List of synonyms for the term")
  • Base Pydantic model for term information, extended by DetailedTermInfo for the get_term_info tool output schema.
    class TermInfo(BaseModel):
        iri: HttpUrl = Field(..., description="IRI of the term")
        ontology_name: str = Field(..., description="Name of the ontology containing the term")
        short_form: str = Field(..., description="Short form identifier for the term")
        label: str = Field(..., description="Human-readable label for the term")
        obo_id: Optional[str] = Field(None, description="OBOLibrary ID for the term", alias="oboId")
        is_obsolete: Optional[bool] = Field(False, description="Indicates if the term is obsolete")
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves information, implying a read-only operation, but doesn't specify aspects like authentication needs, rate limits, error handling, or what 'detailed information' entails (e.g., format, fields). This leaves significant gaps in understanding the tool's behavior.

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 is appropriately sized and front-loaded, making it easy to parse quickly. Every part of the sentence contributes to understanding the tool's basic function.

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?

Given the tool's low complexity (1 parameter, no nested objects) and the presence of an output schema (which should cover return values), the description is minimally adequate. However, it lacks context on usage relative to siblings and behavioral details, making it incomplete for effective agent use without additional inference.

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

Parameters2/5

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

The input schema has 1 parameter ('id') with 0% description coverage, meaning the schema provides no details about the parameter. The description adds no information about the 'id' parameter, such as its format, source, or examples. With low schema coverage, the description fails to compensate, leaving the parameter's meaning unclear.

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

Purpose3/5

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

The description states the tool's purpose ('Get detailed information about a specific term') with a clear verb ('Get') and resource ('term'), but it lacks specificity about what constitutes 'detailed information' and doesn't differentiate from sibling tools like 'get_term_ancestors' or 'get_term_children' which also retrieve term-related information. This makes it vague rather than specific.

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?

No guidance is provided on when to use this tool versus alternatives. With siblings like 'find_similar_terms', 'search_terms', and 'get_term_ancestors', the description fails to indicate that this tool is for retrieving information about a single known term by ID, as opposed to searching or exploring relationships. This omission leaves usage unclear.

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/seandavi/ols-mcp-server'

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