get status
Check the operational status of the TabNews API to verify service availability and connectivity.
Instructions
get status from tabnews api
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get status"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/status.ts:25-44 (handler)The handler function for the 'get status' tool. It fetches the API status using getApiStatus(), formats it as JSON text, and returns it wrapped in an McpResponse.
handler: async (): Promise<McpResponse> => { try { const result = await getApiStatus(); const content: McpTextContent = { type: "text", text: `API Status:\n\n${JSON.stringify(result, null, 2)}`, }; return { content: [content], }; } catch (error) { if (error instanceof Error) { throw new Error(`Failed to check API status: ${error.message}`); } else { throw new Error("Failed to check API status"); } } }, - src/index.ts:24-29 (registration)Registration of the 'get status' tool (checkStatusTool) with the MCP server using server.tool().
server.tool( checkStatusTool.name, checkStatusTool.description, checkStatusTool.parameters, checkStatusTool.handler ); - src/services/api.ts:15-20 (helper)Helper function getApiStatus() that fetches the status from the TabNews API endpoint /status.
export async function getApiStatus(): Promise<GetStatusResponse> { const response = await fetch(`${TABNEWS_API_URL}/status`); const data = await response.json(); return data as GetStatusResponse; } - src/types/index.ts:33-36 (schema)Type definition for the GetStatusResponse returned by the API status endpoint, used in the tool handler.
export interface GetStatusResponse { updated_at: string; dependencies: Dependencies; } - src/types/index.ts:65-70 (schema)MCP response type used by the tool handler to structure the output.
export interface McpResponse { content: McpContent[]; _meta?: Record<string, unknown>; isError?: boolean; [key: string]: unknown; }