Skip to main content
Glama

deleteFileVectors

Remove vector data associated with a specific file to manage storage and optimize search performance in the Pinata MCP server.

Instructions

Delete vectors for a file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_idYesID of the file to delete vectors for

Implementation Reference

  • The deleteFileVectors tool handler - deletes vector embeddings for a file by making a DELETE request to the Pinata vectorize API endpoint. Takes a file_id parameter and returns a success message with the API response or an error.
    server.tool(
      "deleteFileVectors",
      "Delete vectors for a file",
      {
        file_id: z.string().describe("ID of the file to delete vectors for"),
      },
      async ({ file_id }) => {
        try {
          const url = `https://uploads.pinata.cloud/v3/vectorize/files/${file_id}`;
    
          const response = await fetch(url, {
            method: "DELETE",
            headers: getHeaders(),
          });
    
          if (!response.ok) {
            throw new Error(
              `Failed to delete file vectors: ${response.status} ${response.statusText}`
            );
          }
    
          const data = await response.json();
          return {
            content: [
              {
                type: "text",
                text: `✅ File vectors deleted\n\n${JSON.stringify(data, null, 2)}`,
              },
            ],
          };
        } catch (error) {
          return errorResponse(error);
        }
      }
    );

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