DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to validate PACT messages with protocol schemas with Openpactprotocol

Check Agent Cards, messages, errors, and JWT claims against the Zod schemas.

Short answer: Open packages/protocol to find the Zod schemas for Agent Card, messages, errors, and JWT claims; then add @openpactprotocol/protocol to your project with pnpm add @openpactprotocol/protocol; call the matching schema's parse or safeParse method on each incoming object. All steps.

Authorization notice. Openpactprotocol is dual-use. Only use it on software, sites and systems you own or have explicit permission to test.

Who it is forA developer or coding agent writing a Provider or personal agent that must reject malformed PACT payloads before acting on them.

The problemHand-written checks drift from the spec, so malformed Agent Cards or JWT claims can slip through.

The outcomeIncoming PACT objects are parsed against the protocol package, and invalid objects produce clear validation errors.

What you need first

  • Node.js and pnpm installed
  • Git access to clone openpactprotocol/openpactprotocol
  • PostgreSQL for the reference Provider, as named in the README
  • Basic familiarity with TypeScript and OAuth concepts

Steps

  1. Open packages/protocol to find the Zod schemas for Agent Card, messages, errors, and JWT claims.
  2. Add @openpactprotocol/protocol to your project with pnpm add @openpactprotocol/protocol. (inferred, check the README)
  3. Call the matching schema's parse or safeParse method on each incoming object.
  4. Log the validation errors for any object that fails and reject it.
  5. Run your existing tests with a sample Agent Card and a malformed one.

Prompt for your agent

In the openpactprotocol/openpactprotocol repo, use the Zod schemas in packages/protocol to validate the sample payload at <payload-path>. Output whether it is an Agent Card, a message, an error, or JWT claims, and list any validation errors. Verify the result by running the schema against one valid and one invalid sample.

Caveat. The package name @openpactprotocol/protocol comes from the README, but the install command is inferred, so confirm the published package name before adding it.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for openpactprotocol/openpactprotocol and "Validate PACT messages with protocol schemas"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer