Skip to main content
Glama

approve_completion

Approve submitted work to complete a job. Use this when reviewing human-submitted work to move jobs from SUBMITTED to COMPLETED status, enabling payment and review processes.

Instructions

Approve submitted work for a job. Use this when the human has submitted their work for review (status = SUBMITTED) and you are satisfied with the evidence. Moves the job to COMPLETED, after which you can pay and leave a review.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
job_idYesThe job ID
agent_keyYesYour agent API key (hp_...)

Implementation Reference

  • The handler for 'approve_completion' tool. Makes a PATCH request to /api/jobs/{job_id}/approve-completion with the agent_key header. Returns a success message with job ID and status, or throws an error if the API call fails.
          if (name === 'approve_completion') {
            const res = await fetch(`${API_BASE}/api/jobs/${args?.job_id}/approve-completion`, {
              method: 'PATCH',
              headers: {
                'Content-Type': 'application/json',
                'X-Agent-Key': args?.agent_key as string,
              },
            });
    
            if (!res.ok) {
              const error = await res.json() as ApiError;
              throw new Error(error.reason || error.error || `API error: ${res.status}`);
            }
    
            const result = await res.json() as { id: string; status: string; message: string };
    
            return {
              content: [
                {
                  type: 'text',
                  text: `**Work Approved!**
    
    **Job ID:** ${result.id}
    **Status:** ${result.status}
    
    The work has been approved. You can now pay the human using \`mark_job_paid\` and then leave a review with \`leave_review\`.`,
                },
              ],
            };
          }
  • src/tools.ts:459-476 (registration)
    Registration of the 'approve_completion' tool in the ListToolsRequestSchema handler. Defines the tool name, description (for approving submitted work when status is SUBMITTED), and inputSchema with required 'job_id' and 'agent_key' parameters.
      name: 'approve_completion',
      description:
        'Approve submitted work for a job. Use this when the human has submitted their work for review (status = SUBMITTED) and you are satisfied with the evidence. Moves the job to COMPLETED, after which you can pay and leave a review.',
      inputSchema: {
        type: 'object',
        properties: {
          job_id: {
            type: 'string',
            description: 'The job ID',
          },
          agent_key: {
            type: 'string',
            description: 'Your agent API key (hp_...)',
          },
        },
        required: ['job_id', 'agent_key'],
      },
    },

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/human-pages-ai/humanpages'

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