Skip to main content
Glama
seandavi

OLS MCP Server

by seandavi

find_similar_terms

Identify related terms in biological and medical ontologies using LLM embeddings to expand search results and discover semantic connections.

Instructions

Find terms similar to the given term using LLM embeddings.

Args: term_iri: The IRI of the reference term ontology: The ontology identifier size: Maximum number of similar terms to return

Returns: JSON formatted list of similar terms

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
term_iriYes
ontologyYes
sizeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function implementing the 'find_similar_terms' tool logic. It calls the OLS API endpoint /llm_similar to find similar terms based on LLM embeddings for the given term IRI in the specified ontology. Includes input schema via type annotations and docstring. Registered via @mcp.tool() decorator.
    @mcp.tool()
    async def find_similar_terms(
        term_iri: str,
        ontology: str,
        size: int = 10
    ) -> str:
        """Find terms similar to the given term using LLM embeddings.
        
        Args:
            term_iri: The IRI of the reference term
            ontology: The ontology identifier
            size: Maximum number of similar terms to return
        
        Returns:
            JSON formatted list of similar terms
        """
        encoded_iri = url_encode_iri(term_iri)
        
        params: dict[str, Any] = {
            "page": 0,
            "size": size
        }
        
        url = f"{OLS_BASE_URL}/api/v2/ontologies/{ontology}/classes/{encoded_iri}/llm_similar"
        
        try:
            response = await client.get(url, params=params)
            response.raise_for_status()
            data = response.json()
            return format_response(data, size)
            
        except httpx.HTTPError as e:
            return f"Error finding similar terms: {str(e)}"
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 mentions 'using LLM embeddings', which hints at the method, but lacks details on performance (e.g., speed, accuracy), limitations (e.g., embedding availability, ontology support), or output behavior (e.g., format specifics, error handling). For a tool with no annotations, this leaves significant gaps in understanding its operational traits.

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

Conciseness4/5

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

The description is well-structured and appropriately sized, with a clear purpose statement followed by 'Args' and 'Returns' sections. Each sentence serves a purpose: the first explains the tool's function, and the others document parameters and output. It's front-loaded with the core action, though the 'Args' and 'Returns' labels add slight verbosity without detracting from clarity.

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 moderate complexity (3 parameters, no annotations, but with an output schema), the description is partially complete. It covers the basic purpose and parameters, and the output schema handles return values, reducing the need for detailed output explanation. However, it lacks context on when to use it versus siblings and behavioral details, making it adequate but with clear gaps for effective agent invocation.

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?

The description lists parameters ('term_iri', 'ontology', 'size') and their purposes in the 'Args' section, adding meaning beyond the input schema, which has 0% description coverage. However, it doesn't fully compensate for the schema gap—e.g., it doesn't explain parameter formats (like IRI structure) or constraints (like valid 'size' ranges). With 3 parameters and low schema coverage, the added value is moderate but incomplete.

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 tool's purpose: 'Find terms similar to the given term using LLM embeddings.' It specifies the verb ('find'), resource ('terms'), and method ('using LLM embeddings'), which distinguishes it from siblings like 'get_term_info' or 'search_terms'. However, it doesn't explicitly differentiate from all siblings, such as how it compares to 'search_terms' in functionality.

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 'find_similar_terms' over sibling tools like 'search_terms' or 'get_term_info', nor does it specify prerequisites or exclusions. Usage is implied only by the purpose statement, with no explicit context for selection.

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