check-session-status
Check the status of a deepfake analysis session to determine if an image authenticity assessment is complete.
Instructions
Check the status of a deepfake analysis session.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sessionUuid | Yes | Session UUID to check status for. | |
| format | No | Output format. | text |
Implementation Reference
- server.js:458-498 (handler)The handler function that implements the core logic of the 'check-session-status' tool. It fetches the status from the Proofly API using the sessionUuid, formats the output in JSON or text, and handles errors like 404 for unknown sessions.
async handleCheckSessionStatus(params) { logInfo("Handling check-session-status with params:", params); const { sessionUuid, format = 'text' } = params; if (!sessionUuid) { throw new McpError(ErrorCode.InvalidParams, "Missing sessionUuid parameter"); } try { logInfo(`Fetching status for UUID ${sessionUuid}`); const statusResp = await axios.get(`${PROOFLY_CONFIG.baseUrl}/api/${sessionUuid}/status`); const statusData = statusResp.data; logInfo(`Status data for ${sessionUuid}:`, statusData); if (format === 'json') { return { content: [{ type: "text", text: JSON.stringify(statusData, null, 2) }] }; } else { // Simple text representation of the status let output = `**Session Status for ${sessionUuid}:**\n`; output += `* Status: ${statusData.status || 'N/A'}\n`; if (statusData.message) { output += `* Message: ${statusData.message}\n`; } if (statusData.result) { output += `* Result available: Yes\n`; } return { content: [{ type: "text", text: output }] }; } } catch (error) { logError("Error in handleCheckSessionStatus:", error.message); if (error.response) { logError("Error response data:", error.response.data); logError("Error response status:", error.response.status); } // If API returns 404 for unknown UUID, this may be expected if (error.response && error.response.status === 404) { throw new McpError(ErrorCode.NotFound, `Session with UUID ${sessionUuid} not found.`); } throw new McpError(ErrorCode.ServerError, `Failed to check session status: ${error.message}`); } } - server.js:209-220 (schema)The input schema definition for the 'check-session-status' tool, specifying required sessionUuid and optional format parameter.
{ name: "check-session-status", description: "Check the status of a deepfake analysis session.", inputSchema: { type: "object", properties: { sessionUuid: { type: "string", description: "Session UUID to check status for." }, format: { type: "string", enum: ["json", "text"], default: "text", description: "Output format." }, }, required: ["sessionUuid"], }, }, - server.js:236-237 (registration)Registers the list of tools including 'check-session-status' via the ListToolsRequestSchema handler.
this.mcpServer.setRequestHandler(ListToolsRequestSchema, async () => ({ tools })); - server.js:247-248 (registration)Registers the handler dispatch for 'check-session-status' in the CallToolRequestSchema switch statement.
case "check-session-status": return await this.handleCheckSessionStatus(args);