Skip to main content
Glama

vectorizeFile

Convert files into vector embeddings to enable AI-powered semantic search and content analysis.

Instructions

Vectorize a file for AI/semantic search capabilities

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_idYesID of the file to vectorize

Implementation Reference

  • src/index.ts:1712-1747 (registration)
    Registration and handler for the vectorizeFile tool - makes a POST request to Pinata's vectorize API to enable AI/semantic search on a file
    server.tool(
      "vectorizeFile",
      "Vectorize a file for AI/semantic search capabilities",
      {
        file_id: z.string().describe("ID of the file to vectorize"),
      },
      async ({ file_id }) => {
        try {
          const url = `https://uploads.pinata.cloud/v3/vectorize/files/${file_id}`;
    
          const response = await fetch(url, {
            method: "POST",
            headers: getHeaders(),
          });
    
          if (!response.ok) {
            const errorText = await response.text();
            throw new Error(
              `Failed to vectorize file: ${response.status} ${response.statusText}\n${errorText}`
            );
          }
    
          const data = await response.json();
          return {
            content: [
              {
                type: "text",
                text: `✅ File vectorized successfully!\n\n${JSON.stringify(data, null, 2)}`,
              },
            ],
          };
        } catch (error) {
          return errorResponse(error);
        }
      }
    );
  • Input schema definition for vectorizeFile - accepts a file_id string parameter
    {
      file_id: z.string().describe("ID of the file to vectorize"),
    },
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 states the tool 'vectorizes' a file, implying a write/mutation operation, but doesn't disclose behavioral traits such as permissions required, whether it's idempotent, rate limits, or what happens on failure. The description is minimal and lacks critical 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 a single, efficient sentence with zero waste. It's front-loaded with the core action and purpose, making it easy to parse. Every word earns its place, and there's no redundancy or unnecessary elaboration.

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?

Given the tool's complexity (a mutation operation for vectorization), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what vectorization entails, the return values, error conditions, or side effects. For a tool with no structured support, more detail is needed to be adequately helpful.

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 input schema has 100% description coverage, with 'file_id' clearly documented. The description adds no additional meaning beyond the schema, such as format examples or constraints. With high schema coverage, the baseline is 3, as the description doesn't compensate but also doesn't detract.

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 ('vectorize') and resource ('a file'), specifying it's for 'AI/semantic search capabilities'. This distinguishes it from sibling tools like 'deleteFileVectors' or 'queryVectors', though it doesn't explicitly differentiate from all siblings. The purpose is specific but could be more precise about what vectorization entails.

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 prerequisites (e.g., file must exist), when not to use it (e.g., for non-search purposes), or refer to related tools like 'deleteFileVectors' or 'queryVectors'. Usage is implied by the purpose but lacks explicit context.

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