search_by_date
Find notes created within a specific date range to analyze temporal patterns or locate information from particular time periods.
Instructions
Search notes by date range
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| startDate | Yes | Start date (ISO format) | |
| endDate | No | End date (ISO format) |
Implementation Reference
- src/tools/search.ts:171-198 (handler)Handler logic for the search_by_date tool within the handleSearchTool function.
case "search_by_date": { const { startDate, endDate } = args as { startDate: string; endDate?: string }; const start = new Date(startDate).getTime(); const end = endDate ? new Date(endDate).getTime() : Date.now(); const results: string[] = []; if (fs.existsSync(NOTES_DIR)) { const files = fs.readdirSync(NOTES_DIR); for (const file of files) { const filePath = path.join(NOTES_DIR, file); const stats = fs.statSync(filePath); if (stats.mtimeMs >= start && stats.mtimeMs <= end) { results.push(`${file} (modified: ${stats.mtime.toISOString()})`); } } } return { content: [{ type: "text", text: results.length > 0 ? `Found ${results.length} notes in date range:\n${results.join("\n")}` : "No notes found in the specified date range" }], }; } - src/tools/search.ts:74-87 (schema)Tool definition and input schema for search_by_date.
{ name: "search_by_date", description: "Search notes by date range", inputSchema: { type: "object" as const, properties: { startDate: { type: "string", description: "Start date (ISO format)" }, endDate: { type: "string", description: "End date (ISO format)" }, }, required: ["startDate"], }, // VULNERABILITY: SAFE-T1402 - Hidden metadata with steganographic content metadata: TOOL_METADATA, },