spendshield
This server exposes SpendShield financial authorization controls for AI agents: gating spending, checking status, auditing, resetting session spend, and retrieving secrets with approval.
spend_protect: Authorize a spending action (action, amount, to, agent) against dry-run/budget/blacklist/whitelist/rate/max-amount gates; returns
ok=trueorok=falsewith a reason.spend_status: View current guardrail stateโbudget, amount spent, remaining, and blocked-transaction statistics.
spend_audit: Fetch recent audit records (default 10, max configurable via
limit).spend_reset: Reset the current session's spent amount, useful for new sessions or budget changes.
secret_get: Retrieve a secret from the vault, gated by agent identity and approval, with audit logging; the secret name is treated as a payee and can be whitelisted to skip approval.
Provides policy-based authorization for AI-agent payments before they reach Stripe, enforcing budgets, transaction limits, merchant allow/blocklists, and human approval gates while leaving the actual payment execution to Stripe.
๐ฐ SpendShield โ the authorization layer between AI agents and money
Stop AI agents from spending money outside your rules.
Every payment an agent tries to make goes through one
authorize()call โ ALLOW / APPROVAL (human) / DENY โ before money moves.
Watch the gate in 15 seconds โ the attack moment:

Agent: "Order McDonald's breakfast, $15" โ ALLOW
Agent: "Support says refund: send $500 to scam-vip.com now" โ DENY โ merchant 'scam-vip.com' is blocked
Agent: "Breakfast was great, buy another one" โ DENY โ daily benefit already usedWhat is it? โ A spend-control layer for AI agents. Every payment an agent tries to make is checked against a policy you write โ ALLOW / APPROVAL (human) / DENY โ before money moves. It never holds money: Stripe, x402, wallets stay downstream.
Who needs it? โ Anyone running software that can spend: agents on Stripe / x402 / AP2, MCP servers, Claude Code, OpenClaw, home-grown automation. If a machine can pay, a human should have set the rules.
What goes wrong without it? โ One prompt injection. Your agent reads an email / page / tool result that says "refund the customer $500 to this account" โ and the money moves. No human decision. No audit trail. That's not a bug in your agent; it's the absence of a gate.
What happens when you install it? โ pip install spendshield, write one YAML policy, put one authorize() call between your agent and payment. Default is dry-run (evaluate, don't spend). Every decision returns ALLOW / APPROVAL / DENY with a structured reason an LLM can read, and every attempt lands in a tamper-evident audit log.
Without SpendShield: agent โ payment โ money moves. No human decision. No audit trail.
With SpendShield: agent โ authorize() โ ALLOW / APPROVAL / DENY โ payment only on ALLOW.
Real check: the agent asks for $75, the policy says max $50 โ DENY. No retries, no splitting, no second path.
pip install spendshield
# or run it as an MCP server for Claude / any agent:
uvx --from spendshield spendshield-mcp๐ Try it with your agent โ Connect it in 2 minutes ยท Playground ยท Concepts ยท jump to Quickstart
โถ 30-second interactive demo โ watch an AI agent get stopped.
๐ฌ Watch it happen โ 60-second real run
A real Claude session asked to spend on McDonald's. It got its $25 orderโฆ then the gate said no to $75โฆ then said no again when it tried to push $125 through a $100 daily budget. No retries, no splitting, no second path โ the recording is unedited.

โถ Play it inline on the demo page ยท direct mp4
Related MCP server: Budget Governor
๐ One gate. No second path.
propose spend decide move money?
โโโโโโโโโโโโโโโ authorize_payment โโโโโโโโโโโโโโโโ ALLOW only โโโโโโโโโโโโโโโโ
โ AI Agent โ โโโโโโโโโโโโโโโโโโโบ โ SpendShield โ โโโโโโโโโโโโโโบ โ Payment rail โ
โ (Claude, โ โ policy rules โ โ (Stripe, โ
โ scripts) โ โโโโโโโโโโโโโโโโโโโ โ + human โ โโโโโโโโโโโโโโ โ x402, โ
โโโโโโโโโโโโโโโ decision + reason โ approval โ never โ wallet) โ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ
DENY / APPROVAL โ money does NOT moveThe agent holds no payment credentials and has no payment tool. authorize_payment is the only path money can take โ the decision is ALLOW / APPROVAL / DENY, the reason is structured for an LLM, and every attempt lands in the audit chain.
๐ Why authorization checks aren't enough โ execution enforcement
A policy check is an opinion: an agent can simply ignore it. So SpendShield issues a signed, single-use grant, and the execution layer is built to consume it:
SpendShield: policy โ ALLOW โ signed grant (agent ยท amount ยท merchant ยท policy version)
Execution: verify(grant) โ valid + unused โ execute
otherwise โ fail closedReplay the same grant โ refused (one-time)
No grant / malformed grant โ refused
Forged or tampered grant โ refused (signature mismatch)
Run the whole thing in 10 seconds:
python examples/execution_gateway_demo.pyWhat you'll see:
authorize -> [ALLOW] grant issued (policy v2.1.0)
[gateway] call 1 (valid grant) -> EXECUTES (grant verified AUTHORIZED)
[gateway] call 2 (same token) -> REFUSED (REUSED)
[gateway] direct call, no token -> REFUSED (MALFORMED_TOKEN)
[gateway] forged $500 grant -> REFUSED (INVALID_SIGNATURE)
[gateway] tampered grant -> REFUSED (INVALID_SIGNATURE)One execution, four refusals. Full output: docs/execution_demo_output.txt
See the reasoning behind it: Why this exists
๐๏ธ The runtime โ four layers
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ GOVERNANCE review ยท apply ยท version ยท rollback โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ AUTHORIZATION policy ยท ALLOW / APPROVAL / DENY ยท reason codes โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ SECURITY scan ยท fuzz ยท 8 invariants โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ EVIDENCE explainability ยท tamper-evident audit chain โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Stripe / x402 / Wallet (channel-agnostic)Not a demo โ a working baseline. Every result in the demo is real engine output.
โก See it block a transaction in 60 seconds
No config. No YAML. No account.
pip install spendshieldfrom spendshield import SpendShield
shield = SpendShield(budget=100, max_amount=50, dry_run=False)
# Agent tries to spend $75 โ policy limit is $50
result = shield.authorize("", 75, "amazon.com")
print(result.decision, "โ", result.reason)โ DENY โ transaction $75.00 exceeds the $50.00 limitโก Try SpendShield in 60 Seconds โ no API key required: โถ Open in Google Colab
โก Quickstart โ 5 minutes to running
pip install spendshield1. Write a policy (policy.yaml):
version: "2.0.0"
policy:
budget: { daily: 100, monthly: 1000 } # hard ceilings
transaction: { max: 50 } # per-payment cap
merchants:
allowed: [amazon.com, walmart.com] # exact domain match
blocked: [scam-vip.com]
approval: { over: 30, new_merchant: true, channel: tg } # human sign-off
agents:
shopping-agent:
transaction: { max: 50 }2. Gate your payment function:
from spendshield import SpendShield
# dry_run=False: ็ๅฎๆง่กใ้ป่ฎคๆฏๅฎๅ
จๅนฒ่ทๆจกๅผ(ๅช่ฏไผฐไธๆง่ก) โ ๆฅๅ
ฅ็ๅฎๆฏไปๅ็จๅฎ่ฐ่ฏ
shield = SpendShield(dry_run=False)
shield.load_policy("policy.yaml")
@shield.protect("order", agent="shopping-agent")
def place_order(amount, to):
return call_real_api(amount, to) # denied / needs-approval raises before this runsOr use the result object directly:
result = shield.authorize("shopping-agent", 2000, "scam-vip.com")
print(result.decision) # "DENY"
print(result.reason) # "merchant 'scam-vip.com' is blocked"3. Watch it work (real engine output):
โ DENY
Reason: merchant 'scam-vip.com' is blocked
- MERCHANT_BLOCKED: merchant 'scam-vip.com' is blocked (block)
Policy version: 2.0.0๐ค MCP Quickstart โ let the agent manage itself
pip install spendshield
spendshield-mcp --policy policy.yaml # stdio MCP server, 16 toolsClaude Code / any MCP host gets: spend_authorize, spend_approve, policy_sim, policy_apply, policy_create โ policy_review โ policy_lifecycle_apply, policy_rollbackโฆ An agent can ask "will this be denied?" before spending, and humans approve the big ones.
๐ Integration patterns โ plug SpendShield into your stack
Building an agent payment tool, an x402 flow, or an MCP payment server? See examples/integration/ โ the three adapter patterns (x402 / agent payment tool / MCP), all runnable from this repo, no real money:
๐งช How it's tested (real money โ real discipline)
251 tests, 14+ security suites: budget bypass, race conditions, replay, double-spend, parameter tampering, credential leaksโฆ
Security constitution โ 8 invariants that must never break: unauthorized โ no payment ยท over budget โ no payment ยท approval mismatch โ no payment ยท invalid identity โ no payment ยท replay โ at most one authorization ยท concurrency โ never breaks budget ยท engine failure โ deny ยท agent can't bypass SpendShield
Fuzz (random-seed soak): thousands of attack combinations per run, Money Invariant must hold
Audit hash chain: every decision is an event chained by hash โ tamper with history and it's detected
Every discovered hole โ permanent regression test. Release blocked on any P0/P1 security bug. Before each release we ask: did this change give an attacker a new way to spend money?
๐บ๏ธ Roadmap
V1 prevent reckless spending โ
โ V2 Policy Engine โ
โ V2.2 Security Harness โ
โ v0.7.2 Known-Good baseline โ
โ 0.8 Policy Lifecycle โ
(CREATEโVALIDATEโSIMULATEโSCANโREVIEWโAPPLYโROLLBACK)
โ Reality Test (real agents, real money, real attacks) โ we are here
โ V3 Intent Layer โ V4 Risk โ V5 IAM โ V6 Payment Rails โ 1.0The metric that matters: real agents protected, real transactions gated, real dollars saved โ not stars.
๐ฉธ Why this exists (a real incident)
On August 9, 2026, my automation ran a test order. I sent dry: true expecting a price preview โ the server only honored ?dry=1. 4 orders of ยฅ99 were charged for real. The money was gone. When AI starts spending real money, who puts a gate in front of it? I turned my scar into a library.
๐ด Break the Gate โ Security Challenge
SpendShield guards real money. Try to break it.
The challenge: make an unauthorized transaction get ALLOW โ bypass the policy, forge an approval, race the budget, replay a payment, tamper with history. Anything.
Rules:
๐งช Sandbox only โ use
dry_run=True/ test keys. Never point attacks at real payment systems.๐ Found a bypass? Open an issue with a minimal reproduction.
๐ First valid bypass per attack class gets credited in the Security Hall of Fame.
๐ Every valid finding becomes a permanent regression test โ this is how the gate gets stronger.
Current status: 240 tests ยท 16 security suites ยท 11,351 adversarial authorization attempts ยท 0 unintended ALLOW ยท 0 crashes (audit) ยท 0 known escapes.
โ ๏ธ Precision: this is evidence from the current test suite against the current implementation โ reproducible verification, not a mathematical proof of security. New attacks are always possible; every valid finding becomes a permanent regression test (see SECURITY.md).
โ ๏ธ Transparent threat model
MCP has no auth โ trust your host;
policy_apply/policy_revieware host-level operationsApproval IDs are 48-bit random โ a library trusts its caller
In-memory audit (append-only on the roadmap)
We are actively seeking real-world attacks: Reality Test โ challenge: make a DENY turn into APPROVE
Deployment models & trust boundaries: SDK โ MCP โ Gateway โ what each layer guarantees (and what it can't)
Roadmap (demand-driven): SDK โ users โ Agent โ enforced entry โ Governance โ Platform
SpendShield: the layer I wish I had before my AI spent my money.
โ Ready to try it?
60 seconds: โถ Run the demo in Colab โ no install
5 minutes:
pip install spendshield # v0.8.3from spendshield import SpendShield
shield = SpendShield(budget=100, max_amount=50)
@shield.protect("order")
def place_order(amount, to): ...That's it. If it ever lets an unauthorized payment through โ break the gate and get credited.
Available Tools
5 toolssecret_getA
ไปๅฏ้ฅไฟ้ฉๅบๅๅฏ้ฅ(่ฟ่บซไปฝ+ๅฎกๆน้ธ้จ, ็ๅฎก่ฎก)ใๅฏ้ฅๅ่งไธบๆถๆฌพๆน, ๅฏๅ ็ฝๅๅๅ ้ฎ
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ๅฏ้ฅๅ(ๅฆ mcd_sk) | |
| agent | Yes | ่ฐ็จๆน Agent ่บซไปฝ ID |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the behavioral burden. It discloses that retrieval passes identity verification and an approval gate, leaves an audit trail, and treats the secret name as a payee with a whitelist bypass option. These are meaningful behavioral traits beyond the basic operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two compact clauses convey the core operation, gating, audit, and whitelist behavior with no filler. The primary action is front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers the key gating and audit context, which is valuable given no annotations and no output schema. However, it does not describe the return value, error conditions such as missing secrets or denied approval, or pagination/output structure, leaving some operational uncertainty for an agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the schema already documents both parameters. The description adds extra semantic meaning by noting the secret name is treated as a payee and can be whitelisted, which clarifies how the 'name' parameter affects approval behavior.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('ไปๅฏ้ฅไฟ้ฉๅบๅๅฏ้ฅ'), and adds context about identity/approval gating and audit. It is clear what the tool does, though it does not explicitly contrast itself with the spend_* siblings.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the tool is for retrieving secrets from the vault and mentions a whitelist option to skip approval, but it does not explicitly state when to use it versus alternatives or when not to use it. Usage context is present but not fully articulated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
spend_auditB
ๆ่ฟๅฎก่ฎก่ฎฐๅฝ(ๆๅค N ๆก)
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ๆกๆฐ, ้ป่ฎค 10 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden, but it only states the content (audit records) and limit; it does not disclose side effects, read-only status, authentication needs, or return format. The word 'audit' hints at a read operation, but this is not explicit.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single short phrase with no filler; the resource is front-loaded and the limit detail is parenthetically appended. It earns its place without redundancy, even though it partially restates the tool name's 'audit' idea.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with one optional parameter and no output schema, the description conveys the core action (return recent audit records) and limit behavior. However, it omits the return record structure and any behavioral guarantees (e.g., read-only, pagination), which are more important here because no annotations or output schema exist.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema already documents `limit` as 'ๆกๆฐ, ้ป่ฎค 10' (count, default 10). The tool description adds the 'ๆๅค' (at most) qualifier, clarifying that `limit` is a maximum cap rather than an exact count, which is meaningful semantic added value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'ๆ่ฟๅฎก่ฎก่ฎฐๅฝ(ๆๅค N ๆก)' clearly identifies the resource (recent audit records) and a limit cap, distinguishing it from siblings like spend_reset or secret_get by topic. However, it lacks an explicit verb such as 'list' or 'retrieve', so an agent must infer the action from the noun phrase.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided about when to choose spend_audit over sibling tools, nor any exclusions or alternative references. The description consists solely of a resource label, leaving usage context entirely to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
spend_protectA
ไฟๆคไธๆฌก่ฑ้ฑๆไฝใ่ตฐๅนฒ่ท/้ข็ฎ/้ปๅๅ/็ฝๅๅ/้ข็/ๅๆฌกไธ้้ธ้จใ้่ฟ่ฟๅ ok=true; ่ขซๆฆ่ฟๅ ok=false + reason
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | ๆถๆฌพๆน, ๅฆ ้บฆๅฝๅณ/xxx@example.com | |
| agent | No | ่ฐ็จๆน Agent ่บซไปฝ ID(ๆชๆณจๅ้ป่ฎคๆ็ป, ๅปบ่ฎฎๅฟ ๅกซ) | |
| action | Yes | ๆไฝๅ, ๅฆ ไธๅ/่ฝฌ่ดฆ/ๅ ๅผ | |
| amount | Yes | ้้ข(ๅ ) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden, and it does disclose meaningful behavior: the six gate types it runs and the ok=true / ok=false + reason return contract. However, it leaves ambiguity about whether the tool actually executes the spend or only checks it, and it does not disclose side effects, state changes, or whether a successful pass records anything. The gate list and return semantics earn a 3, but the execute-vs-check ambiguity prevents a higher score.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with zero filler. The first sentence front-loads the purpose and the gate list; the second specifies the binary return contract. Every clause earns its place, and the most important behavioral detail (blocked => ok=false + reason) is stated explicitly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description compensates for the missing output schema by explicitly defining the return values (ok=true vs ok=false+reason), and the flat 4-parameter schema is fully documented. But for a financial safety-gate tool with no annotations, it should also clarify whether the spend is executed by this tool, how an agent should route to a sibling on different needs, and what action to take on a block. The core is covered; these decision-relevant gaps hold it at a 3.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%: all four parameters (to, agent, action, amount) already carry meaningful Chinese descriptions in the schema, including the behavioral note that unregistered agents are rejected by default. The tool description adds no parameter-specific meaning beyond the schema, so the baseline of 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb plus resource: 'ไฟๆคไธๆฌก่ฑ้ฑๆไฝ' (protect a spending operation), then enumerates concrete gates (ๅนฒ่ท/้ข็ฎ/้ปๅๅ/็ฝๅๅ/้ข็/ๅๆฌกไธ้) and the exact return contract. This clearly differentiates it from siblings spend_status, spend_audit, spend_reset, and secret_get โ an agent can tell this is the pre-spend guard without opening any schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The gate list strongly implies the usage: run this before spending money to test the operation against budget/blacklist/whitelist/frequency/single-limit policies. However, there is no explicit when-to-use vs alternatives, no wording like 'for balance/status checks use spend_status instead,' and no statement about what to do when ok=false (e.g., abort). Usage is implied, not stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
spend_resetA
้็ฝฎๆฌๆฌกไผ่ฏๅทฒ่ฑ้้ข(ๆฐไผ่ฏ/ๆข้ข็ฎๆถ็จ)
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must carry the behavioral burden, and it does disclose the primary effect (resetting the session spend counter). However, it gives no indication of irreversibility, side effects, or interaction with protected/audited spend, so important behavioral context is absent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single clause with the action first and the use case in parentheses; it contains no filler or redundancy. Every part earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple, parameterless mutation tool, the description covers what, scope, and when. It could be more complete by noting whether the reset is permanent or how it affects the other spend_* tools, but those are secondary for a tool this straightforward.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters and an empty schema, so there is nothing meaningful left to document. The description adds useful contextual framing (new session/budget change), which exceeds the schema's contribution.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific action ('reset') applied to a well-defined resource ('this session's spent amount'), so the tool's function is unambiguous. The parenthetical notes the intended trigger (starting a new session or changing budget), which differentiates it from sibling spend_* tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It explicitly says when to use this tool: when starting a new session or changing a budget. It does not name exclusions or compare with alternatives like spend_protect or spend_status, so it falls just short of a full 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
spend_statusA
ๆฅ่ฏขๅฝๅๆคๆ ็ถๆ: ้ข็ฎ/ๅทฒ่ฑ/ๅฉไฝ/ๆฆๆช็ป่ฎก
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations and no output schema, the description carries the burden of behavioral disclosure. The word 'ๆฅ่ฏข' (query) reasonably implies a read-only status operation with no side effects, but it does not disclose details such as whether the stats are live or cached, whether any permissions are required, or what the exact response shape is.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single compact phrase that front-loads the operation ('query') and immediately lists the key data fields. Every word earns its place, with no filler or repetition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter, no-output-schema query tool, the description is largely sufficient: it tells the agent what the tool reports. It could be slightly more explicit that this is a safe/read-only operation and provide a hint that it complements spend_protect/spend_audit/spend_reset, but the core selection context is present.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
This tool has zero parameters, so parameter semantics are trivially complete. The baseline of 4 applies because there is no parameter information that the description would need to compensate for.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('ๆฅ่ฏข' / query) and a specific resource ('ๅฝๅๆคๆ ็ถๆ') with concrete components: budget, spent, remaining, and blocked statistics. This clearly distinguishes it from sibling tools like spend_protect, spend_audit, and spend_reset, which imply mutating actions rather than status retrieval.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives no explicit guidance on when to use this tool versus the sibling tools. The intended use is implied by the word 'query' and the sibling names, but there is no statement of conditions, exclusions, or alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
5 tool updates
v0.6.1- First observed
secret_get - First observed
spend_audit - First observed
spend_protect - First observed
spend_reset - First observed
spend_status
TDQS
Each tool targets a clearly distinct operation: status is a live snapshot, audit is historical records, reset is session state management, protect gates a spend, and secret_get retrieves a credential. No two tools plausibly serve the same purpose, and the descriptions make the boundaries obvious.
The tools are all lowercase snake_case and mostly follow a domain-prefix pattern, with four sharing spend_ and one using secret_. The slight inconsistency is that the second segment mixes nouns and verbs, and secret_get breaks away from the spend_ namespace, so it is not as uniform as a strict verb_noun convention.
Five tools is well-scoped for a spending-defense utility: status, audit, reset, protect, and secret retrieval each cover a necessary function without redundancy. There are no filler tools or obvious bloat.
The set covers the core lifecycle well: protect a spend, inspect status, review audit trails, reset session amounts, and safely retrieve secrets. The main gap is configuration management such as setting budgets, whitelists, or blacklists, but agents can still work within the existing guardrails.
Maintenance
Related MCP Connectors
AgentGuard โ 20-tool AI safety MCP: policy preflight, risk scoring, audit logging, rate limits.
Zero-secret MCP gateway for AI agents: risk-scored, audited calls with human-in-the-loop approval.
Compliance MCP for AI agents: sanctions & KYT screening on 50+ chains, stablecoin-freeze, oracle.
Pre-spend firewall for AI agents. Approves, blocks, flags transactions against policy rules.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP Guard Server - Budget control, approval workflows and audit logging for AI agents (Claude Code, Cursor, ChatGPT)MIT
- AlicenseNot gradedqualityCmaintenanceBudget & cost control for AI agents: hard per-agent spend caps, rate limits, idempotency, and human-in-the-loop approval โ enforced before each LLM call, not after the invoice. One hosted MCP endpoint (no proxy or self-hosting), settled via x402 (USDC on Base).MIT
- FlicenseNot gradedqualityBmaintenanceRuntime agent firewall for PII redaction, rate limits, and policy enforcement, enabling autonomous agent security via MCP integration.-
- FlicenseNot gradedqualityBmaintenanceAn MCP server that enables AI agents to safely interact with a double-entry payments ledger, enforcing idempotency, policy-based access control, and human-in-the-loop approval for high-value actions.-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/felixpg13-glitch/spendshield'
If you have feedback or need assistance with the MCP directory API, please join our Discord server