# Give an agent a deterministic data-checking tool

Disclosure: I’m building TaskMint. This tutorial was prepared with AI assistance. The examples use synthetic data and the published local engine.

An agent may choose the next step in a workflow, but a data check should have a narrow contract. What fields does it accept? What does it do with ambiguous input? Does a completed diagnostic mean the underlying record is valid?

TaskMint’s local engine makes those questions explicit. It runs ten bounded utilities without a language-model call. Here is a small integration you can inspect before considering hosted execution.

## Run a tool locally

Download taskmint-local.mjs from the TaskMint agent guide and save it beside a new demo.mjs file. Inspect the downloaded module before running it. With Node 22 or later, use:

```js
import { runService } from './taskmint-local.mjs';

const result = runService('field_diff', {
  before: { stock: 12 },
  after: { stock: 10 },
  fields: ['stock']
});
console.log(JSON.stringify(result, null, 2));
```

Run node demo.mjs. This call is local: it does not upload the records, connect a wallet or charge anything. Inspect the complete result rather than reducing every response to a success boolean.

## Put the check at a deliberate point in the agent workflow

Use a narrow tool wrapper whose input matches the published service schema. The agent supplies structured data, receives the result and then follows the operator’s policy. Do not interpret a completed diagnostic as permission to update another system.

Three worked examples are available. A catalogue audit checks supplied price and identity conditions in batches of up to 50 flat records. Reconciliation compares up to 50 rows in each snapshot using typed keys and exact values. Invoice arithmetic checks supplied integer-string amounts and positive integer quantities; it does not perform OCR, choose tax rates or authenticate documents.

These limits are part of the tool contract. They are not details to hide from an agent planner.

## If you need hosted execution

The runnable hosted client is available at https://taskmint-sign-proof-node22-production.up.railway.app/taskmint-hosted-client.mjs. Its prepare/probe/recover commands need no wallet and never sign. Explicit purchases use your existing buyer authorizer, a spending cap and a durable one-attempt lock. Follow https://taskmint-sign-proof-node22-production.up.railway.app/agent-quickstart.md for the complete example.

The public API base is https://taskmint-sign-proof-node22-production.up.railway.app. Use it for all checkout and agent paths; the website and the API have separate hosts. The receipt API uses an explicit quote–pay–recover sequence. Request a quote with a service and payload; keep its order ID and private receipt token; review the exact USDC amount, Base network, recipient and expiry. A quote alone does not pay.

The payment endpoint returns x402 v2 requirements. A compatible externally owned wallet authorizes the exact payment under the operator’s policy. If the outcome is uncertain, recover through the same receipt rather than buying again. Results are available for 24 hours. The documentation contains the endpoints, headers and failure cases.

For per-job purchases, POST /api/agent/SERVICE_ID with a payload and a private request_token generated from 32 random bytes (64 lowercase hex characters). A compatible x402 v2 client can answer the 402 challenge at the same URL. Persist the exact body and token: use it for read-only recovery without a signature after a timeout or HTTP 202. Never create a replacement payment for an uncertain result. The official x402 fetch client is covered by local tests. This is not a hosted MCP server. Verify runtime reachability before paid use. Local execution remains free.

For operators considering annual access, the first 100 annual subscriptions cost 49.50 USDC for the first 12-month term, against a standard annual price of 99 USDC. The allowance is 3,000 completed jobs per subscription month, with manual renewal and no automatic overages. Light usage may be cheaper per job.

Integration guide, downloadable code and contracts:

https://taskmint-lab.danborn83.chatgpt.site/agents?c=tutorial_agent
