Skip to main content
Glama
LuciferForge

agent-safety-mcp

by LuciferForge

cost_guard_configure

Set weekly budget limits and alerts to control API spending in agent-safety-mcp, preventing unexpected costs during AI operations.

Instructions

Configure the cost guard budget.

Args: weekly_budget_usd: Maximum spend per week in USD. alert_at_pct: Warn when spend reaches this percentage (0.0-1.0). dry_run: If true, all calls raise BudgetExceededError (safe for testing).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
weekly_budget_usdNo
alert_at_pctNo
dry_runNo

Implementation Reference

  • The handler for the 'cost_guard_configure' tool, which updates the global '_guard' state with a new CostGuard instance using the provided configuration parameters.
    @mcp.tool()
    def cost_guard_configure(
        weekly_budget_usd: float = 10.0,
        alert_at_pct: float = 0.80,
        dry_run: bool = False,
    ) -> dict:
        """Configure the cost guard budget.
    
        Args:
            weekly_budget_usd: Maximum spend per week in USD.
            alert_at_pct: Warn when spend reaches this percentage (0.0-1.0).
            dry_run: If true, all calls raise BudgetExceededError (safe for testing).
        """
        global _guard
        _guard = CostGuard(
            weekly_budget_usd=weekly_budget_usd,
            alert_at_pct=alert_at_pct,
            dry_run=dry_run,
        )
        return {
            "status": "configured",
            "weekly_budget_usd": weekly_budget_usd,
            "alert_at_pct": alert_at_pct,
            "dry_run": dry_run,
        }
Behavior3/5

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

No annotations provided, so description carries full burden. It successfully discloses that dry_run mode raises BudgetExceededError and describes the alert threshold behavior. However, it omits whether configuration is persistent/session-based, atomic, or if multiple calls overwrite previous settings.

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?

Uses an efficient 'Args:' docstring format with zero wasted words. Each line earns its place by providing type hints (USD, percentage range) or behavioral context. Slightly unconventional structure for MCP but highly scannable.

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

Completeness3/5

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

Adequate for a 3-parameter configuration tool with no output schema. Documents all inputs including defaults behavior, but lacks mention of return values or side effects (e.g., whether it validates the configuration immediately or only on subsequent cost operations).

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by documenting all three parameters: weekly_budget_usd (units), alert_at_pct (range 0.0-1.0), and dry_run (behavioral effect). This prevents the agent from guessing parameter semantics.

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 'Configure the cost guard budget' - a specific verb (configure) with clear resource (cost guard budget). Combined with the name, it clearly distinguishes from siblings like cost_guard_check (monitoring) and cost_guard_status (reporting).

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

Usage Guidelines2/5

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

No explicit guidance on when to use this tool versus alternatives like cost_guard_check or cost_guard_record. No mention of prerequisites (e.g., whether to call this before recording costs) or configuration persistence scope.

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

Install Server

Other Tools

Latest Blog Posts

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/LuciferForge/agent-safety-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server