bear_context_remove_external
Remove a file from the external context library and automatically regenerate the index. Use to delete external content that is no longer required.
Instructions
Remove a file from the external/ directory in the context library. Deletes the file and regenerates the index. Use when external content is no longer needed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | Filename in external/ to remove |
Implementation Reference
- mcp-server/src/tools.ts:1167-1195 (registration)Tool registration as part of the `tools` Record<string, ToolHandler> export. Maps tool name 'bear_context_remove_external' to its Tool definition and buildArgs function.
bear_context_remove_external: { tool: { name: "bear_context_remove_external", description: "Remove a file from the external/ directory in the context library. Deletes the file and regenerates the index. Use when external content is no longer needed.", inputSchema: { type: "object" as const, properties: { filename: { type: "string", description: "Filename in external/ to remove", }, }, required: ["filename"], }, annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, }, }, buildArgs: (input) => [ "context", "remove-external", String(input.filename), "--json", ], }, }; - mcp-server/src/tools.ts:1172-1181 (schema)Input schema for the tool: requires a single 'filename' string parameter representing the file in external/ to remove.
inputSchema: { type: "object" as const, properties: { filename: { type: "string", description: "Filename in external/ to remove", }, }, required: ["filename"], }, - mcp-server/src/tools.ts:1188-1193 (handler)Handler logic: buildArgs function that generates the command-line arguments to invoke the underlying bcli tool with 'context remove-external'.
buildArgs: (input) => [ "context", "remove-external", String(input.filename), "--json", ], - mcp-server/src/index.ts:29-31 (helper)Registration via ListToolsRequestSchema (line 29-31) and generic dispatch via CallToolRequestSchema (line 33-122) which calls handler.buildArgs(params) then execBcliWithReauth to run the bcli CLI.
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: Object.values(tools).map((t) => t.tool), }));