list_projects
Retrieve all projects from your local MyContext directory to manage project documentation organized in markdown files.
Instructions
List all available projects in the context directory (~/.mycontext/)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:31-35 (handler)Core handler function that lists all top-level project directories by ensuring the context directory exists and reading its subdirectories.async function listProjects(): Promise<string[]> { await ensureContextDir(); const entries = await fs.readdir(CONTEXT_DIR, { withFileTypes: true }); return entries.filter((e) => e.isDirectory()).map((e) => e.name); }
- src/index.ts:159-167 (registration)Registration of the 'list_projects' tool in the ListToolsRequestSchema handler, including name, description, and empty input schema (no parameters required).{ name: "list_projects", description: "List all available projects in the context directory (~/.mycontext/)", inputSchema: { type: "object", properties: {}, }, },
- src/index.ts:232-249 (handler)Execution handler within the CallToolRequestSchema switch that invokes listProjects and returns the formatted response.case "list_projects": { const projects = await listProjects(); return { content: [ { type: "text", text: JSON.stringify( { projects, context_directory: CONTEXT_DIR, }, null, 2 ), }, ], }; }
- src/index.ts:22-28 (helper)Helper function used by listProjects to ensure the context directory exists before listing projects.async function ensureContextDir() { try { await fs.access(CONTEXT_DIR); } catch { await fs.mkdir(CONTEXT_DIR, { recursive: true }); } }
- src/index.ts:163-166 (schema)Input schema definition for the list_projects tool (empty object, no required parameters).inputSchema: { type: "object", properties: {}, },