Skip to main content
Glama
qwert666
by qwert666

query_ontology_type

Retrieve objects of a specific ontology type by applying filter conditions to query Foundry datasets.

Instructions

Query for objects in a given ontology type. Use list_ontology_types to get the list of available types

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
whereYesFilter conditions
object_typeYesName of a ontology type (e.g. User, Article, etc.)

Implementation Reference

  • The main handler function for the 'query_ontology_type' tool. It is decorated with @mcp.tool() which also serves as the registration. The function parameters include Pydantic Field descriptions that define the input schema. It retrieves objects from the Foundry ontology using the provided where filter and object_type.
    @mcp.tool() def query_ontology_type( ctx: Context, where: dict[any, any] = Field(description="Filter conditions"), object_type: str = Field(description="Name of a ontology type (e.g. User, Article, etc.)") ) -> dict: """ Query for objects in a given ontology type. Use list_ontology_types to get the list of available types """ foundry_client: FoundryClient = ctx.request_context.lifespan_context.foundry_client ontology_id: str = ctx.request_context.lifespan_context.ontology_id all_properties = [prop for prop in foundry_client.ontologies.OntologyObject.list( ontology_id, object_type, page_size=1 ).data[0] if not prop.startswith('__') ] response = foundry_client.ontologies.OntologyObject.search( ontology_id, object_type, select=all_properties, exclude_rid=True, where=where ) return response.data
  • Input schema defined via Pydantic Field in the tool function signature.
    ctx: Context, where: dict[any, any] = Field(description="Filter conditions"), object_type: str = Field(description="Name of a ontology type (e.g. User, Article, etc.)")
  • The @mcp.tool() decorator registers the function as an MCP tool.
    @mcp.tool()

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/qwert666/mcp-server-foundry'

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