m9k_search
Search indexed conversations and files with hybrid search to find relevant past information. Returns compact results with snippets, boosting current project and session content by default.
Instructions
Search indexed past conversations. Returns compact results with snippets. Results from the current project and session are boosted by default. Use m9k_context or m9k_full to drill down.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query (keywords or natural language) | |
| project | No | Filter by project path. Omit for cross-project search. | |
| limit | No | Max results | |
| since | No | ISO-8601 date. Only results after this date. | |
| until | No | ISO-8601 date. Only results before this date (exclusive). | |
| order | No | Sort order: score (relevance), date_asc (oldest first), date_desc (newest first) | score |
| source | No | Filter by source type. Default: all sources. |
Implementation Reference
- src/tools/search.ts:47-66 (handler)The async handler function for 'm9k_search' that calls the underlying search utility.
async ({ query, project, limit, since, until, order }) => { const currentSession = getStat(ctx.db, 'current_session_id') || undefined; const results = await search( ctx.db, { query, project, currentProject: ctx.currentProject, currentSession, limit, since, until, order, }, ctx.searchContext, ); return { content: [{ type: 'text' as const, text: JSON.stringify(results) }], }; }, - src/tools/search.ts:12-46 (registration)Registration and schema definition for 'm9k_search' tool.
server.registerTool( 'm9k_search', { description: 'Search indexed past conversations. Returns compact results with snippets. Results from the current project and session are boosted by default. Use m9k_context or m9k_full to drill down.', inputSchema: { query: z.string().describe('Search query (keywords or natural language)'), project: z .string() .optional() .describe('Filter by project path. Omit for cross-project search.'), limit: z.number().int().min(1).max(50).default(10).describe('Max results'), since: z.string().optional().describe('ISO-8601 date. Only results after this date.'), until: z .string() .optional() .describe('ISO-8601 date. Only results before this date (exclusive).'), order: z .enum(['score', 'date_asc', 'date_desc']) .default('score') .describe( 'Sort order: score (relevance), date_asc (oldest first), date_desc (newest first)', ), source: z .enum(['conversations', 'git', 'files']) .optional() .describe('Filter by source type. Default: all sources.'), }, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false, }, },