Skip to main content
Glama
FiloHany

Video RAG MCP Server

by FiloHany

retrieve_data_tool

Retrieve relevant video segments from indexed content using natural language queries. Returns text, document names, and timestamps for precise video access.

Instructions

Retrieves data from the Ragie index based on the query. The data is returned as a list of dictionaries, each containing the following keys:
- text: The text of the retrieved chunk
- document_name: The name of the document the chunk belongs to
- start_time: The start time of the chunk
- end_time: The end time of the chunk

Args:
    query (str): The query to retrieve data from the Ragie index.

Returns:
    list[dict]: The retrieved data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Implementation Reference

  • server.py:24-43 (handler)
    Handler function for retrieve_data_tool, including registration via @mcp.tool() decorator and schema via type hints and docstring. Executes the tool by calling retrieve_data from main.py.
    @mcp.tool()
    def retrieve_data_tool(query: str) -> list[dict]:
        """
        Retrieves data from the Ragie index based on the query. The data is returned as a list of dictionaries, each containing the following keys:
        - text: The text of the retrieved chunk
        - document_name: The name of the document the chunk belongs to
        - start_time: The start time of the chunk
        - end_time: The end time of the chunk
    
        Args:
            query (str): The query to retrieve data from the Ragie index.
    
        Returns:
            list[dict]: The retrieved data.
        """
        try:
            content = retrieve_data(query)
            return content
        except Exception as e:
            return f"Failed to retrieve data: {str(e)}"
  • Core helper function that implements the data retrieval logic using the Ragie client, formatting the response as list of dicts matching the tool's schema.
    def retrieve_data(query):
        try:
            logger.info(f"Retrieving data for query: {query}")
            retrieval_response = ragie.retrievals.retrieve(request={
                "query": query
            })
    
            content = [
                {
                    **chunk.document_metadata,
                    "text": chunk.text,
                    "document_name": chunk.document_name,
                    "start_time": chunk.metadata.get("start_time"),
                    "end_time": chunk.metadata.get("end_time")
                }
                for chunk in retrieval_response.scored_chunks
            ]
    
            logger.info(f"Successfully retrieved {len(content)} chunks")
            return content
    
        except Exception as e:
            logger.error(f"Failed to retrieve data: {str(e)}")
            raise
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. It discloses that data is returned as a list of dictionaries with specific keys, which adds some behavioral context. However, it lacks details on permissions, rate limits, error handling, or whether the operation is read-only or has side effects. For a retrieval tool with zero annotation coverage, this is insufficient.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded, starting with the core purpose. The structure includes sections for Args and Returns, which is efficient. However, the 'Returns' section partially repeats information from the description body, slightly reducing conciseness.

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 low complexity (1 parameter, no output schema, no annotations), the description is somewhat complete. It covers the purpose, parameter semantics, and return format. However, it lacks usage guidelines and sufficient behavioral transparency, making it adequate but with clear gaps for effective agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds significant meaning beyond the input schema, which has 0% description coverage. It explains that the 'query' parameter is 'The query to retrieve data from the Ragie index,' clarifying its purpose and usage. With only one parameter, this compensation is effective, though it could be more detailed (e.g., query format).

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: 'Retrieves data from the Ragie index based on the query.' It specifies the verb ('retrieves'), resource ('data from the Ragie index'), and mechanism ('based on the query'). However, it doesn't explicitly differentiate from sibling tools like 'ingest_data_tool' or 'show_video_tool', which would require a 5.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools, prerequisites, or specific contexts for usage. The only implied usage is for retrieving data from the Ragie index, but this is basic and lacks explicit when/when-not instructions.

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/FiloHany/Video_RAG_MCP'

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