check_grant
Check if a grant allows spending a specified amount on a target program, verifying allowlist, cap, and root configuration before consumption.
Instructions
Agent consume path. Agent signs. Increments spent_lamports. Does not move SOL. Empty allowlist is denied. cap 0 requires amount 0. Optional root if not in config. Relayer submits if you also call pay.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"amount_lamports": "<amount_lamports>",
"target_program": "<target_program>"
},
"name": "check_grant"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| root | No | Root pubkey if GROKCHAIN_ROOT_KEYPAIR is unset | |
| agent | No | Agent pubkey if GROKCHAIN_AGENT_KEYPAIR is unset (unsigned-tx path) | |
| dry_run | No | ||
| target_program | Yes | Target program id (v1 router mode: local-only INTENTS on localnet; grokchain-devnet INTENTS EYhYtq… on devnet). | |
| amount_lamports | Yes | Amount to consume from the cap counter. 0 is valid (call-only). |