Skip to main content
Glama

queryVectors

Search vectorized files in a group using semantic queries to find relevant content based on meaning rather than keywords.

Instructions

Query vectorized files in a group using semantic search

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
group_idYesID of the group to search
textYesQuery string for semantic search

Implementation Reference

  • src/index.ts:1785-1815 (registration)
    Registration of the queryVectors tool with the MCP server. This defines the tool name, description, input schema (group_id and text parameters), and the async handler function that executes the semantic search query against vectorized files in a Pinata group.
    server.tool(
      "queryVectors",
      "Query vectorized files in a group using semantic search",
      {
        group_id: z.string().describe("ID of the group to search"),
        text: z.string().describe("Query string for semantic search"),
      },
      async ({ group_id, text }) => {
        try {
          const url = `https://uploads.pinata.cloud/v3/vectorize/groups/${group_id}/query`;
    
          const response = await fetch(url, {
            method: "POST",
            headers: getHeaders(),
            body: JSON.stringify({ text }),
          });
    
          if (!response.ok) {
            const errorText = await response.text();
            throw new Error(
              `Failed to query vectors: ${response.status} ${response.statusText}\n${errorText}`
            );
          }
    
          const data = await response.json();
          return successResponse(data);
        } catch (error) {
          return errorResponse(error);
        }
      }
    );
  • Handler implementation for queryVectors tool. Makes a POST request to Pinata's vectorize API endpoint (https://uploads.pinata.cloud/v3/vectorize/groups/{group_id}/query) with the search text, handles errors, and returns the response data using successResponse helper.
    server.tool(
      "queryVectors",
      "Query vectorized files in a group using semantic search",
      {
        group_id: z.string().describe("ID of the group to search"),
        text: z.string().describe("Query string for semantic search"),
      },
      async ({ group_id, text }) => {
        try {
          const url = `https://uploads.pinata.cloud/v3/vectorize/groups/${group_id}/query`;
    
          const response = await fetch(url, {
            method: "POST",
            headers: getHeaders(),
            body: JSON.stringify({ text }),
          });
    
          if (!response.ok) {
            const errorText = await response.text();
            throw new Error(
              `Failed to query vectors: ${response.status} ${response.statusText}\n${errorText}`
            );
          }
    
          const data = await response.json();
          return successResponse(data);
        } catch (error) {
          return errorResponse(error);
        }
      }
    );
Behavior2/5

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

With no annotations, the description carries full burden but provides minimal behavioral insight. It mentions semantic search but doesn't disclose performance characteristics, result format, pagination, authentication needs, or error conditions. For a query tool with no annotations, this leaves significant gaps in understanding how it behaves.

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?

Single sentence with zero waste - every word contributes essential information. Front-loaded with the core purpose, appropriately sized for a simple query tool.

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?

For a query tool with no annotations and no output schema, the description is insufficient. It doesn't explain what 'vectorized files' means, what the search returns, or how results are structured. Given the complexity implied by 'semantic search' and lack of structured output documentation, more context is needed.

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 description coverage is 100%, so the schema fully documents both parameters. The description adds no additional parameter semantics beyond what's in the schema (group_id for group selection, text for query). Baseline 3 is appropriate when schema does all the work.

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 action ('query') and resource ('vectorized files in a group') with the method ('semantic search'). It distinguishes from obvious siblings like 'searchFiles' by specifying vectorized content and semantic search, though it doesn't explicitly contrast with all siblings.

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?

No guidance on when to use this tool versus alternatives like 'searchFiles' or 'getFileById' is provided. The description implies usage for semantic search on vectorized files, but lacks explicit when/when-not instructions or prerequisite context about needing vectorized files first.

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/PinataCloud/pinata-mcp'

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