check_status
Verify API operational status to ensure responsiveness. Use this tool to confirm if the API is active and ready for queries.
Instructions
Check if the API is alive and responding.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {},
"type": "object"
}
Implementation Reference
- src/tools/status.ts:12-27 (handler)The async handler function for the 'check_status' tool. It invokes checkApiStatus() helper and formats a response indicating if the API is 'Online' or 'Offline'.handler: async (): Promise<McpResponse> => { try { const result = await checkApiStatus(); const content: McpTextContent = { type: "text", text: `API Status: ${result.isAlive ? "Online" : "Offline"}` }; return { content: [content], }; } catch (error) { throw new Error(`Failed to check API status: ${error.message}`); } }
- src/index.ts:42-47 (registration)Registration of the checkStatusTool (named 'check_status') into the MCP server using server.tool().server.tool( checkStatusTool.name, checkStatusTool.description, checkStatusTool.parameters, checkStatusTool.handler );
- src/services/api.ts:246-250 (helper)Helper function that performs a GraphQL query to check if the API is alive, returning a StatusResponse.export async function checkApiStatus(): Promise<StatusResponse> { return await client.query({ isAlive: true, }) as StatusResponse; }
- src/config/api.ts:29-32 (schema)Configuration schema defining the tool name 'check_status' and its description. The parameters are defined as empty object {} in the tool definition.status: { name: "check_status", description: "Check if the API is alive and responding." }