Skip to main content
Glama
seandavi

OLS MCP Server

by seandavi

find_similar_terms

Discover terms similar to a specified term within biological and medical ontologies using LLM embeddings. Input a term IRI and ontology identifier to retrieve a JSON list of related terms.

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
ontologyYes
sizeNo
term_iriYes

Implementation Reference

  • The handler function for the 'find_similar_terms' tool, registered via @mcp.tool(). It encodes the term IRI, queries the OLS API for similar terms using LLM embeddings at the /llm_similar endpoint, formats the response, and handles errors.
    @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)}"

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

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