search_thoughts
Filter unconventional thoughts by metadata like rebellion status or assumption challenges to find relevant idea IDs for further exploration.
Instructions
Search for thought IDs by metadata. Returns only matching IDs and metadata, not full content. Enables efficient filtering.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| branchId | No | Optional branch ID to filter thoughts | |
| isRebellion | No | Filter by rebellion status | |
| challengesAssumption | No | Filter by assumption-challenging status | |
| limit | No | Maximum number of results to return (default: 10) |
Implementation Reference
- src/index.ts:254-286 (handler)Handler function for the 'search_thoughts' tool. Filters thoughts by branchId, isRebellion, challengesAssumption, and limit. Returns JSON with metadata and resource URIs only, keeping full content separate.
case "search_thoughts": { const { branchId, isRebellion, challengesAssumption, limit = 10 } = request.params.arguments as any || {}; const thoughts = loadThoughts(); // Filter at the server level - don't send unfiltered data to Claude const filtered = Object.values(thoughts) .filter(t => { if (branchId && t.branchId !== branchId) return false; if (isRebellion !== undefined && t.isRebellion !== isRebellion) return false; if (challengesAssumption !== undefined && t.challengesAssumption !== challengesAssumption) return false; return true; }) .sort((a, b) => b.timestamp - a.timestamp) .slice(0, limit); // Return only metadata - IDs and resource URIs, not full content return { content: [{ type: "text", text: JSON.stringify({ count: filtered.length, thoughts: filtered.map(t => ({ id: t.id, resourceUri: `thought://${t.id}`, isRebellion: t.isRebellion, challengesAssumption: t.challengesAssumption, branchId: t.branchId || "main", timestamp: t.timestamp })) }, null, 2) }] }; } - src/index.ts:101-125 (registration)Tool registration in ListToolsRequestSchema handler, defining name, description, and input schema for 'search_thoughts'.
{ name: "search_thoughts", description: "Search for thought IDs by metadata. Returns only matching IDs and metadata, not full content. Enables efficient filtering.", inputSchema: { type: "object", properties: { branchId: { type: "string", description: "Optional branch ID to filter thoughts" }, isRebellion: { type: "boolean", description: "Filter by rebellion status" }, challengesAssumption: { type: "boolean", description: "Filter by assumption-challenging status" }, limit: { type: "number", description: "Maximum number of results to return (default: 10)" } } } } - src/index.ts:104-123 (schema)Input schema definition for the 'search_thoughts' tool, specifying parameters for filtering thoughts.
inputSchema: { type: "object", properties: { branchId: { type: "string", description: "Optional branch ID to filter thoughts" }, isRebellion: { type: "boolean", description: "Filter by rebellion status" }, challengesAssumption: { type: "boolean", description: "Filter by assumption-challenging status" }, limit: { type: "number", description: "Maximum number of results to return (default: 10)" } }