Skip to main content
Glama
qwert666

Foundry MCP Server

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
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. The description mentions querying objects but doesn't disclose key behavioral traits such as whether this is a read-only operation, potential rate limits, authentication needs, or what happens on errors. For a query tool with zero annotation coverage, this is a significant gap, as it leaves the agent guessing about safety and operational details.

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

Conciseness5/5

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

The description is appropriately sized and front-loaded, consisting of two concise sentences: the first states the purpose, and the second provides usage guidance. Every sentence earns its place by adding value without redundancy, making it efficient and easy to parse.

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 complexity (querying ontology objects with two parameters), lack of annotations, and no output schema, the description is somewhat complete but has gaps. It covers the purpose and a prerequisite, but doesn't explain return values, error handling, or behavioral traits. This makes it adequate as a minimum viable description, but it could benefit from more details to fully guide the agent.

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 schema description coverage is 100%, meaning the input schema already documents both parameters ('where' and 'object_type') with descriptions. The description adds minimal value beyond this, only implying that 'object_type' relates to ontology types and referencing 'list_ontology_types' for available types. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, as the description doesn't significantly enhance parameter understanding.

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: 'Query for objects in a given ontology type.' It specifies the verb ('query') and resource ('objects in a given ontology type'), making it understandable. However, it doesn't explicitly differentiate from sibling tools like 'query_dataset' or 'list_ontology_types', which keeps it from a score of 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for usage: 'Use list_ontology_types to get the list of available types.' This gives a prerequisite step, helping users understand when to use this tool. However, it doesn't specify when to use this tool versus alternatives like 'query_dataset' or 'execute_function', so it lacks explicit exclusions or comparisons, preventing a score of 5.

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

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