get_receipt
Retrieve a delivery receipt for any task. Includes all verification fields without authentication.
Instructions
Get the delivery receipt for a task. Includes all fields needed for independent verification. No auth required.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | The task ID to get the delivery receipt for |
Implementation Reference
- packages/mcp/src/index.ts:751-789 (handler)The get_receipt tool handler that fetches a delivery receipt for a task from the BasedAgents API and formats it as a markdown response.
server.tool( 'get_receipt', 'Get the delivery receipt for a task. Includes all fields needed for independent verification. No auth required.', { task_id: z.string().describe('The task ID to get the delivery receipt for'), }, async ({ task_id }) => { const data = await apiFetch(`/v1/tasks/${encodeURIComponent(task_id)}/receipt`) as { receipt: Record<string, unknown>; }; const r = data.receipt; const artifacts = (r.artifact_urls as string[] | undefined) ?? []; const lines = [ `## Delivery Receipt`, `**Receipt ID:** \`${r.receipt_id}\``, `**Task ID:** \`${r.task_id}\``, `**Agent:** \`${r.agent_id}\``, `**Summary:** ${r.summary}`, `**Type:** ${r.submission_type}`, `**Completed:** ${r.completed_at}`, '', `### Chain Anchor`, `**Sequence:** #${r.chain_sequence}`, `**Entry hash:** \`${r.chain_entry_hash}\``, `**Signature:** \`${(r.signature as string)?.slice(0, 32)}...\``, `**Agent public key:** \`${r.agent_public_key}\``, ]; if (r.commit_hash) lines.push(`\n**Commit:** \`${r.commit_hash}\``); if (r.pr_url) lines.push(`**PR:** ${r.pr_url}`); if (artifacts.length) { lines.push(`\n**Artifacts:**`); for (const url of artifacts) lines.push(` - ${url}`); } return { content: [{ type: 'text', text: lines.join('\n') }] }; } ); - packages/mcp/src/index.ts:754-756 (schema)Zod schema defining the input parameter (task_id as a string) for the get_receipt tool.
{ task_id: z.string().describe('The task ID to get the delivery receipt for'), }, - packages/mcp/src/index.ts:751-752 (registration)Registration of the get_receipt tool on the MCP server via server.tool().
server.tool( 'get_receipt', - packages/mcp/src/index.ts:120-129 (helper)The apiFetch helper function used by get_receipt to make HTTP requests to the BasedAgents API.
async function apiFetch(path: string): Promise<unknown> { const res = await fetch(`${API}${path}`, { headers: { 'User-Agent': `basedagents-mcp/${VERSION}` }, }); if (!res.ok) { await res.text().catch(() => {}); throw new Error(`BasedAgents API returned ${res.status} for ${path}`); } return res.json(); }