Skip to main content
Glama
Prooflie

Proofly MCP Integration

by Prooflie

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
NameRequiredDescriptionDefault
sessionUuidYesSession UUID to check status for.
formatNoOutput format.text

Implementation Reference

  • 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}`);
      }
    }
  • 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);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Prooflie/mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server