Skip to main content
Glama

box_metadata_get_instance_on_file_tool

Retrieve metadata instance from a specified file and template in Box. Requires file ID and template key for precise data extraction.

Instructions

Get a metadata instance on a file.

Args: ctx (Context): The context object containing the request and lifespan context. file_id (str): The ID of the file to get the metadata from. template_key (str): The key of the metadata template.

Returns: dict: The metadata instance associated with the file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_idYes
template_keyYes

Implementation Reference

  • The handler function that implements the core logic of the tool. It retrieves the Box client from context and calls the underlying box_metadata_get_instance_on_file function from the box_ai_agents_toolkit.
    async def box_metadata_get_instance_on_file_tool( ctx: Context, file_id: str, template_key: str, ) -> dict: """ Get the metadata template instance associated with a specific file. Args: ctx (Context): The context object containing the request and lifespan context. file_id (str): The ID of the file to get the metadata from. template_key (str): The key of the metadata template. Returns: dict: The metadata instance associated with the file. """ box_client = get_box_client(ctx) return box_metadata_get_instance_on_file(box_client, file_id, template_key)
  • The registration of the tool using FastMCP's mcp.tool() decorator within the register_metadata_tools function.
    mcp.tool()(box_metadata_get_instance_on_file_tool)
  • The import statement in the registry file that brings in the handler function from the implementation file.
    from tools.box_tools_metadata import ( box_metadata_delete_instance_on_file_tool, box_metadata_get_instance_on_file_tool, box_metadata_set_instance_on_file_tool, box_metadata_template_create_tool, box_metadata_template_get_by_key_tool, box_metadata_template_get_by_name_tool, box_metadata_template_list_tool, box_metadata_update_instance_on_file_tool, )

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/box-community/mcp-server-box'

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