get_server_status
Check PromptArchitect MCP server availability and performance metrics including AI service status, cache efficiency, and response latency.
Instructions
Get PromptArchitect server status and performance metrics.
Use this tool to check: • Whether AI (Gemini) is available • Cache hit rate and request statistics • Average response latency
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.ts:246-270 (handler)The handler logic for the 'get_server_status' tool. It retrieves performance statistics using getStats(), checks API availability with isApiClientAvailable(), constructs a status object including server info, performance metrics, and overall status, then returns it as JSON text content.case 'get_server_status': { const stats = getStats(); const status = { server: 'promptarchitect-mcp', version: '1.0.0', apiAvailable: isApiClientAvailable(), performance: { totalRequests: stats.totalRequests, cacheHits: stats.cacheHits, cacheHitRate: stats.totalRequests > 0 ? `${Math.round((stats.cacheHits / stats.totalRequests) * 100)}%` : 'N/A', avgLatencyMs: stats.avgLatencyMs, }, status: isApiClientAvailable() ? 'ready' : 'degraded (using fallbacks)', }; return { content: [ { type: 'text', text: JSON.stringify(status, null, 2), }, ], }; }
- src/server.ts:182-195 (registration)Registration of the 'get_server_status' tool in the ListTools response, including its name, description, and empty input schema (no parameters required).{ name: 'get_server_status', description: `Get PromptArchitect server status and performance metrics. Use this tool to check: • Whether AI (Gemini) is available • Cache hit rate and request statistics • Average response latency`, inputSchema: { type: 'object', properties: {}, required: [], }, },
- src/server.ts:190-194 (schema)Input schema definition for the 'get_server_status' tool, which requires no parameters.inputSchema: { type: 'object', properties: {}, required: [], },
- src/utils/gemini.ts:94-100 (helper)Helper function getStats() that returns Gemini API performance metrics: total requests, cache hits, and average latency, using module-level counters.export function getStats(): { totalRequests: number; cacheHits: number; avgLatencyMs: number } { return { totalRequests, cacheHits, avgLatencyMs: totalRequests > 0 ? Math.round(totalLatencyMs / totalRequests) : 0, }; }
- src/utils/apiClient.ts:37-39 (helper)Helper function isApiClientAvailable() that checks if the PromptArchitect API client is configured by verifying the apiUrl.export function isApiClientAvailable(): boolean { return !!apiUrl; }