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

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)}"

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