bear_context_index
Retrieve a structured index of all context files to identify which documents to fetch before answering queries. Includes cache freshness metadata.
Instructions
Get the context library index — a structured table of contents of all files (Bear notes, external files, inbox). Read this FIRST before answering questions from context. Use it to identify which files to fetch, rather than loading everything. Includes cache freshness metadata.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- mcp-server/src/tools.ts:816-832 (handler)Tool definition and handler for 'bear_context_index'. It has no input parameters and builds CLI args ['context', 'index', '--json'] to fetch the context library index (a table of contents of all files).
bear_context_index: { tool: { name: "bear_context_index", description: "Get the context library index — a structured table of contents of all files (Bear notes, external files, inbox). Read this FIRST before answering questions from context. Use it to identify which files to fetch, rather than loading everything. Includes cache freshness metadata.", inputSchema: { type: "object" as const, properties: {}, }, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, }, }, buildArgs: () => ["context", "index", "--json"], }, - mcp-server/src/index.ts:29-31 (registration)Tool registration in the MCP server. All tools from the 'tools' object (including bear_context_index) are registered via ListToolsRequestSchema and invoked via CallToolRequestSchema.
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: Object.values(tools).map((t) => t.tool), })); - mcp-server/src/tools.ts:821-824 (schema)Input schema for bear_context_index — takes no input parameters (empty properties object).
inputSchema: { type: "object" as const, properties: {}, },