Skip to main content
Glama
qwert666
by qwert666

query_ontology_type

Retrieve objects from a specific ontology type in Foundry datasets by applying filter conditions to locate relevant data entries.

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 uses the FoundryClient to search for objects in the specified ontology type based on the 'where' filter, dynamically determining properties to select. The function parameters include Pydantic Field descriptions serving as input schema.
    @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

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