Skip to main content
Glama

Register a child grant, paying if canopy asks

register_grant

Register a child grant with canopy, resume it by logId until complete, and handle x402 payment requirements within caps or relay your own payment.

Instructions

Register a child grant with canopy (POST /register/{R}/grants, your authority grant as the parent) and follow it to its receipt; call it again with the same logId to resume until it reports complete. If canopy answers 402 and a payer is configured, it pays within the server's hard caps (per call, per UTC day, one network and asset, testnet only by default) and reports any cap that refuses. With no payer it returns the payment requirements: pay them from your own x402 wallet and call again with payment set to the X-PAYMENT value. Every payment for a grant carries a nonce derived from that grant, so retries and overlapping calls can never pay for it twice. When complete it returns the completed grant for delegate_sealing and register_statement.

Input Schema

NameRequiredDescriptionDefault
grantNoa child grant signed elsewhere (base64 or a file path), instead of logId
logIdNothe child log id issue_grant returned: register_grant resumes that grant from wherever the last call reached
baseUrlNothe canopy SCRAPI base URL; falls back to FORESTRIE_BASE_URL — never defaulted by the package itself
paymentNorelay mode: the X-PAYMENT header value your own x402 wallet produced for the payment requirements register_grant returned
rootLogIdNothe forest's root log id (R in /register/{R}/grants); falls back to FORESTRIE_ROOT_LOG_ID
parentGrantNoyour authority grant: the completed grant that created your authority log and names this server's authority key, as base64 or a file path; falls back to FORESTRIE_AUTHORITY_GRANT

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.4/5.0
Behavior5/5

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

The description adds substantial behavioral context beyond the annotations: it explains the 402 payment flow, payer hard caps, testnet-by-default behavior, no-payer requirement response, relay payment via X-PAYMENT, and nonce-derived anti-double-pay protection. Annotations already disclose open-world and non-idempotent behavior, and the description enriches that with concrete operational details.

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

Conciseness4/5

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

The description is a single dense paragraph, but it is front-loaded with the primary action and then follows the important payment/resume branches. It is long for a tool description, yet the complexity of the registration and payment lifecycle justifies most of the detail.

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

Completeness5/5

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

For a complex, multi-call, payment-aware registration tool with no output schema, the description covers the lifecycle, resume behavior, payment paths, caps, anti-double-pay guarantees, and handoff to delegate_sealing/register_statement. An agent has enough information to call and retry it correctly.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all six parameters well. The description adds some workflow meaning for logId and payment, but does not meaningfully extend baseUrl, rootLogId, or parentGrant beyond what the schema provides, so the baseline 3 is appropriate.

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 states a specific verb and resource: register a child grant with canopy via POST /register/{R}/grants, using the authority grant as parent, and follow it to receipt. It also distinguishes the workflow from sibling tools by naming delegate_sealing and register_statement as downstream consumers of the completed grant.

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

Usage Guidelines4/5

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

It gives clear usage instructions for the multi-step lifecycle: call again with the same logId to resume, handle 402 with or without a configured payer, and use payment mode when paying from your own x402 wallet. It does not explicitly say when not to use this tool or compare it directly to issue_grant, but the context is actionable.

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