Skip to main content
Glama

verify_receipt

Verify the authenticity and integrity of a signed artifact or receipt using an explicit Ed25519 public key or an embedded key. Accepts raw JSON, local file, or optional key hex.

Instructions

Verify a single signed artifact or receipt using an explicit public key or any embedded public key.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
artifact_jsonNoRaw JSON artifact string.
pathNoPath to a local JSON artifact file.
public_key_hexNoOptional Ed25519 public key hex (64 bytes as hex).

Implementation Reference

  • The core verification handler function `verifySingle` that executes the artifact verification logic using the embedded public key or an explicit hex key.
    function verifySingle(artifact, publicKeyHex) {
      const core = getArtifactCore(artifact);
      const key = publicKeyHex || deriveEmbeddedKey(artifact);
      if (!key) {
        return {
          valid: false,
          error: 'no_public_key',
          type: artifact?.type || core.artifact?.type || 'unknown',
          format: core.format,
          kid: core.kid,
          issuer: artifact?.issuer || null,
          hash: null,
        };
      }
    
      const result = verifyArtifact(core.artifact, key);
      const unsigned = { ...core.artifact };
      delete unsigned.signature;
    
      return {
        valid: !!result.valid,
        error: result.valid ? null : (result.error || 'invalid_signature'),
        type: artifact?.type || core.artifact?.type || 'unknown',
        format: core.format,
        kid: core.kid,
        issuer: artifact?.issuer || null,
        hash: canonicalHash(unsigned),
      };
    }
  • The MCP tool handler for `verify_receipt` – receives artifact JSON/path and optional public key, calls `readJsonInput` and `verifySingle`, returns text result.
    server.tool(
      'verify_receipt',
      'Verify a single signed artifact or receipt using an explicit public key or any embedded public key.',
      {
        artifact_json: z.string().optional().describe('Raw JSON artifact string.'),
        path: z.string().optional().describe('Path to a local JSON artifact file.'),
        public_key_hex: z.string().optional().describe('Optional Ed25519 public key hex (64 bytes as hex).'),
      },
      async (args) => {
        try {
          const artifact = readJsonInput(args.path, args.artifact_json);
          return textResult(verifySingle(artifact, args.public_key_hex || null));
        } catch (error) {
          return textResult({ ok: false, error: error.message });
        }
      }
    );
  • Input schema for `verify_receipt`: optional `artifact_json`, `path`, and `public_key_hex` strings.
    {
      artifact_json: z.string().optional().describe('Raw JSON artifact string.'),
      path: z.string().optional().describe('Path to a local JSON artifact file.'),
      public_key_hex: z.string().optional().describe('Optional Ed25519 public key hex (64 bytes as hex).'),
    },
  • server.js:193-209 (registration)
    Registration of the `verify_receipt` tool via `server.tool(...)`.
    server.tool(
      'verify_receipt',
      'Verify a single signed artifact or receipt using an explicit public key or any embedded public key.',
      {
        artifact_json: z.string().optional().describe('Raw JSON artifact string.'),
        path: z.string().optional().describe('Path to a local JSON artifact file.'),
        public_key_hex: z.string().optional().describe('Optional Ed25519 public key hex (64 bytes as hex).'),
      },
      async (args) => {
        try {
          const artifact = readJsonInput(args.path, args.artifact_json);
          return textResult(verifySingle(artifact, args.public_key_hex || null));
        } catch (error) {
          return textResult({ ok: false, error: error.message });
        }
      }
    );
  • Helper `readJsonInput` used to parse the artifact from either raw JSON string or file path.
    function readJsonInput(path, raw) {
      if (raw && raw.trim()) return JSON.parse(raw);
      if (path && path.trim()) return JSON.parse(readFileSync(path, 'utf-8'));
      throw new Error('Provide either raw JSON input or a file path.');
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It specifies two verification methods (explicit key or embedded key) but does not disclose return behavior, error handling, or success/failure indication.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single, well-structured sentence with front-loaded verb and resource, no unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Lacks mention of required parameters (e.g., that artifact_json or path must be provided) and does not describe return values or error outcomes, which is important for a verification tool with no output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but description adds extra context about the two verification modes (using explicit public key or embedded key), which clarifies parameter interaction beyond schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('verify') and the resource ('a single signed artifact or receipt'), and distinguishes from sibling 'verify_bundle' which verifies a bundle.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for single artifacts but does not explicitly provide when-not-to-use or mention alternatives like verify_bundle for bundles.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/ScopeBlind/verify-mcp'

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