@stacksona/agent-tools
Deterministic utility tools for agents, available through CLI, TypeScript imports, request files, MCP mode, and native imports for event context and stable task identifiers.
Fast path: deterministic helper tools
- 1Install or run with npx.
npm install -g @stacksona/agent-tools - 2Call one utility.
Use tools for risk checks, policy evaluation, hashing, schema validation, table validation, URL checks, redaction, and proof envelopes.
- 3Feed outputs into approval context.
Use deterministic tool output as reviewer context before a Stacksona decision request.
Package
| Field | Value |
|---|---|
| Name | @stacksona/agent-tools |
| Version documented | 1.0.3 |
| Runtime | Node.js 18 or later |
| Binary | stacksona-agent-tools |
| Use when | You want deterministic tool outputs, explanations, hashes, redacted proofs, and replay-friendly audit context. |
bash
npm install -g @stacksona/agent-tools
npx @stacksona/agent-tools listNative package usage
Use @stacksona/agent-tools directly from your agent runtime when you want deterministic helper output without shelling out to the CLI. Native imports are useful for building Stacksona event payloads, producing replay-friendly proof context, and generating stable task IDs before you call Gate.
- Events: format or enrich
task.started,step.completed, revision, and tool-call context before sending it to/api/agent/tasks/{taskID}/events. - Task IDs: derive unique task identifiers from workflow inputs, action fingerprints, hashes, slugs, timestamps, or your own deterministic naming rules.
- Approval context: include risk checks, policy results, redacted payloads, hashes, and request inspections in the decision request summary or payload.
js
import { callTool } from '@stacksona/agent-tools';
const fingerprint = await callTool('action.fingerprint', {
action: { type: 'refund', amount: 2500, currency: 'usd', customer_id: 'cus_123' },
});
const taskSlug = await callTool('text.slugify', {
text: `refund-${fingerprint.hash}`
});
const taskId = `task-${taskSlug.slug}`;Run as MCP server
bash
stacksona-agent-tools mcpjson
{
"mcpServers": {
"stacksona-agent-tools": {
"command": "stacksona-agent-tools",
"args": ["mcp"]
}
}
}Tool categories
| Category | Tools |
|---|---|
| Calculation and security | calculator.evaluate, password.policy_check, security.hash, security.hmac |
| Proof and data | proof.create, proof.verify, json.format, json.diff, schema.validate, JSON path tools |
| Text and output quality | text.redact_sensitive, text.extract, text.slugify, output.check_constraints, template.render |
| Risk and decision support | risk.requires_approval, action.fingerprint, http.request_inspect, time.window_check, policy tools, URL tools, table tools |
| Files, images, provenance | file.checksum, file.inspect, image.metadata, image.annotate_boxes, ocr.extract_text, provenance.c2pa_check |
Examples
bash
stacksona-agent-tools call action.fingerprint '{"action":{"type":"refund","amount":2500,"currency":"usd","customer_id":"cus_123"}}'
stacksona-agent-tools call http.request_inspect '{"method":"POST","url":"https://api.stripe.com/v1/refunds","headers":{"Authorization":"Bearer sk_live_redacted"},"body":{"charge":"ch_123","amount":2500}}'
stacksona-agent-tools call policy.evaluate '{"facts":{"action":"refund","amount":250},"rules":[{"id":"refund_threshold","if":{"action":"refund","amount":{"gte":100}},"then":{"requires_approval":true,"reason":"refund_above_threshold"}}]}'