Skip to main content
Glama
ragieai

Ragie Model Context Protocol Server

by ragieai

retrieve

Find relevant documents, policies, and product specs in your knowledge base using search and metadata filters. Control result count and recency for accurate answers.

Instructions

Look up information in the Knowledge Base. Use this tool when you need to:

  • Find relevant documents or information on specific topics

  • Retrieve company policies, procedures, or guidelines

  • Access product specifications or technical documentation

  • Get contextual information to answer company-specific questions

  • Find historical data or information about projects

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe query to search for data in the Knowledge Base
filterNoThe metadata search filter on documents. Returns chunks only from documents which match the filter. The following filter operators are supported: $eq - Equal to (number, string, boolean), $ne - Not equal to (number, string, boolean), $gt - Greater than (number), $gte - Greater than or equal to (number), $lt - Less than (number), $lte - Less than or equal to (number), $in - In array (string or number), $nin - Not in array (string or number). The operators can be combined with AND and OR. Read Metadata & Filters guide for more details and examples.
topKNoThe maximum number of results to return. Defaults to 8.
rerankNoWhether to try and find only the most relevant data. Defaults to false.
recencyBiasNoWhether to favor data towards more recent documents. Defaults to false.

Implementation Reference

  • src/index.ts:55-109 (registration)
    Registration of the 'retrieve' tool via server.tool() with its schema and handler.
    server.tool(
      "retrieve",
      description,
      {
        query: z
          .string()
          .describe("The query to search for data in the Knowledge Base"),
        filter: z
          .object({
            field: z.string().describe("The field to filter by"),
            value: z.any().describe("The value to filter by"),
          })
          .describe(
            "The metadata search filter on documents. Returns chunks only from documents which match the filter. The following filter operators are supported: $eq - Equal to (number, string, boolean), $ne - Not equal to (number, string, boolean), $gt - Greater than (number), $gte - Greater than or equal to (number), $lt - Less than (number), $lte - Less than or equal to (number), $in - In array (string or number), $nin - Not in array (string or number). The operators can be combined with AND and OR. Read Metadata & Filters guide for more details and examples."
          )
          .optional(),
        topK: z
          .number()
          .describe("The maximum number of results to return. Defaults to 8.")
          .optional()
          .default(8),
        rerank: z
          .boolean()
          .describe(
            "Whether to try and find only the most relevant data. Defaults to false."
          )
          .optional()
          .default(false),
        recencyBias: z
          .boolean()
          .describe(
            "Whether to favor data towards more recent documents. Defaults to false."
          )
          .optional()
          .default(false),
      },
      async ({ query, filter, topK, rerank, recencyBias }) => {
        const ragie = new Ragie({ auth: RAGIE_API_KEY });
        const retrieval = await ragie.retrievals.retrieve({
          query,
          filter,
          topK,
          rerank,
          recencyBias,
          partition: options.partition,
        });
    
        const content = retrieval.scoredChunks.map((sc) => ({
          type: "text" as const,
          text: sc.text,
        }));
    
        return { content };
      }
    );
  • Zod schema defining the input parameters for the 'retrieve' tool: query (string), filter (optional object with field/value), topK (number, default 8), rerank (boolean, default false), recencyBias (boolean, default false).
    {
      query: z
        .string()
        .describe("The query to search for data in the Knowledge Base"),
      filter: z
        .object({
          field: z.string().describe("The field to filter by"),
          value: z.any().describe("The value to filter by"),
        })
        .describe(
          "The metadata search filter on documents. Returns chunks only from documents which match the filter. The following filter operators are supported: $eq - Equal to (number, string, boolean), $ne - Not equal to (number, string, boolean), $gt - Greater than (number), $gte - Greater than or equal to (number), $lt - Less than (number), $lte - Less than or equal to (number), $in - In array (string or number), $nin - Not in array (string or number). The operators can be combined with AND and OR. Read Metadata & Filters guide for more details and examples."
        )
        .optional(),
      topK: z
        .number()
        .describe("The maximum number of results to return. Defaults to 8.")
        .optional()
        .default(8),
      rerank: z
        .boolean()
        .describe(
          "Whether to try and find only the most relevant data. Defaults to false."
        )
        .optional()
        .default(false),
      recencyBias: z
        .boolean()
        .describe(
          "Whether to favor data towards more recent documents. Defaults to false."
        )
        .optional()
        .default(false),
    },
  • The handler function for the 'retrieve' tool. Creates a Ragie client, calls ragie.retrievals.retrieve() with the input parameters, maps scoredChunks to text content, and returns the content.
    async ({ query, filter, topK, rerank, recencyBias }) => {
      const ragie = new Ragie({ auth: RAGIE_API_KEY });
      const retrieval = await ragie.retrievals.retrieve({
        query,
        filter,
        topK,
        rerank,
        recencyBias,
        partition: options.partition,
      });
    
      const content = retrieval.scoredChunks.map((sc) => ({
        type: "text" as const,
        text: sc.text,
      }));
    
      return { content };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the full burden. It only implies a read-only operation by saying 'Look up information', but fails to explicitly state it is read-only, does not disclose authentication needs, rate limits, or error behavior. This is a significant gap for a retrieval tool.

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 relatively concise, using a bullet list of use cases. It is front-loaded with the purpose statement. However, some redundancy exists with 'Use this tool when you need to' repeated for each item.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has 5 parameters, including a complex nested filter object, and no output schema. The description does not explain the return format, pagination, or how results are structured. It only vaguely mentions 'information', leaving the agent without sufficient context to interpret the response.

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?

Schema coverage is 100% and all parameters have descriptions in the schema. The tool description does not add additional meaning beyond what the schema provides. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Look up information in the Knowledge Base' and lists specific use cases (e.g., 'Find relevant documents', 'Retrieve company policies'). It directly addresses what the tool does with a specific verb and resource.

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 a bullet list of when to use the tool, such as 'Find relevant documents or information' and 'Get contextual information'. It implicitly guides usage but does not explicitly state when not to use or mention alternatives, though no sibling tools exist.

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/ragieai/ragie-mcp-server'

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