Skip to main content
Glama

clear-vectors

Remove all indexed vectors from a specified project directory to maintain clean and optimized data storage, facilitating efficient project management and performance.

Instructions

Clear all indexed vectors for a project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoProject path to clear vectors from (defaults to current directory)

Implementation Reference

  • src/server.ts:491-508 (registration)
    Registers the 'clear-vectors' MCP tool, specifying title, description, input schema, and an async handler that dynamically imports and calls handleClearVectors from ./handlers/vector.ts, then formats the result as MCP content.
    server.registerTool("clear-vectors", { title: "Clear Vectors", description: "Clear all indexed vectors for a project", inputSchema: ClearVectorsSchema.shape, }, async (args) => { const { handleClearVectors } = await import("./handlers/vector"); const result = await handleClearVectors({ path: args.path || process.cwd(), }); return { content: [ { type: "text", text: result } ] }; });
  • Zod schema definition for clear-vectors tool input, accepting optional project path.
    const ClearVectorsSchema = z.object({ path: z.string().optional().describe("Project path to clear vectors from (defaults to current directory)"), });
  • Core utility function that clears all vector chunks from the SQLite database by executing DELETE FROM vector_chunks. Likely called by the missing handleClearVectors handler.
    export async function clearVectorDB(projectPath: string): Promise<void> { const { client } = await getVectorDB(projectPath); try { await client.execute({ sql: 'DELETE FROM vector_chunks', args: [] }); logger.log('Vector database cleared'); } catch (error) { throw new Error(`Failed to clear vector database: ${error instanceof Error ? error.message : String(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/RealMikeChong/ultra-mcp'

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