get_status
Retrieve a project decision status overview with total count and last activity for a quick health check of the decision store.
Instructions
Get project decision status overview including total count and last activity. Use this for a quick health check of the decision store.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | The workspace folder name |
Implementation Reference
- src/mcp/server.ts:610-633 (handler)The 'get_status' tool handler: fetches project status including total decisions, active decisions count, and last activity from history.
case 'get_status': { ensureProject(args); const decisions = await listDecisions(); const history = await getHistory(1); return { content: [ { type: 'text', text: JSON.stringify( { project: getCurrentProject(), storePath: getProjectRoot(), totalDecisions: decisions.length, activeDecisions: decisions.filter((d) => d.status === 'active').length, lastActivity: history[0]?.description || 'No activity yet', }, null, 2 ), }, ], }; } - src/mcp/server.ts:264-277 (schema)Tool registration with name 'get_status' and input schema requiring 'project' (string).
{ name: 'get_status', description: 'Get project decision status overview including total count and last activity. Use this for a quick health check of the decision store.', inputSchema: { type: 'object', properties: { project: { type: 'string', description: 'The workspace folder name', }, }, required: ['project'], }, }, - src/mcp/server.ts:37-62 (helper)The ensureProject helper validates and sets the current project before executing get_status.
function ensureProject(args: unknown): void { if (args && typeof args === 'object' && 'project' in args && (args as Record<string, unknown>).project) { const projectName = (args as Record<string, unknown>).project as string; // Validate: reject project names that look like paths or corpus names // Valid: "my-project", "decisionnode-marketplace" // Invalid: "user/repo", "C:\\path\\to\\folder", "/absolute/path" if (projectName.includes('/') || projectName.includes('\\') || projectName.includes(':')) { throw new Error( `Invalid project name "${projectName}". ` + `Project name must be a simple folder basename (no slashes, colons, or path separators). ` + `Example: "my-project" not "user/repo" or "C:\\path\\to\\folder".` ); } // Also reject if it looks too long (likely a full path) if (projectName.length > 100) { throw new Error( `Invalid project name "${projectName.substring(0, 50)}...". ` + `Project name is too long. Use the folder basename only.` ); } setCurrentProject(projectName); } } - src/store.ts:376-393 (helper)The listDecisions function used by get_status to count total and active decisions.
export async function listDecisions(scope?: string): Promise<DecisionNode[]> { const scopes = scope ? [scope] : await getAvailableScopes(); const allDecisions: DecisionNode[] = []; for (const s of scopes) { const collection = await loadDecisions(s); if (collection.decisions && Array.isArray(collection.decisions)) { allDecisions.push(...collection.decisions); } else { console.warn(`⚠️ Warning: Scope '${s}' is corrupted or empty (missing 'decisions' array). Skipping.`); } } return allDecisions; } - src/history.ts:183-186 (helper)The getHistory function used by get_status to retrieve the latest activity log entry.
export async function getHistory(limit: number = 20): Promise<ActivityLogEntry[]> { const log = await loadActivityLog(); return log.entries.slice(0, limit); }