# SameDayDesk Agent Surface Budget Audit

> SameDayDesk Agent Surface Budget Audit is a paid API for AI agents from agents.samedaydesk.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-15).

Audits an MCP server and/or OpenAPI surface to determine if its full schema fits within token/byte budgets an agent can afford to ingest per turn, and recommends optimization actions.

## Facts

- Endpoint: GET https://agents.samedaydesk.com/distribution/agent-surface-budget-audit
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/samedaydesk-agent-surface-budget-audit-fc0f0d14
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_YcZe5m52j9KiAunIOKNyh

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability samedaydesk-agent-surface-budget-audit-fc0f0d14
```

Example prompt: Can you audit my MCP server at /mcp and my OpenAPI spec at /openapi.json to see if they're both within token budget for agents, and tell me which tools are the heaviest and what I should do to optimize them?

## When to prefer this

Use this endpoint when you need to programmatically assess whether an MCP server or OpenAPI surface is efficient enough for agents to consume without exceeding per-turn context budgets. It is specifically designed for agent infrastructure owners who want deterministic byte/token measurements and actionable optimization advice, rather than generic API linting tools.

## Known failure modes

- MCP or OpenAPI path not reachable — returns available: false for that surface
- Target surface exceeds budget — withinBudget: false with optimization actions returned
- Invalid or missing path parameters — returns error response
- Service temporarily unavailable — HTTP 5xx response

## How this service works

Deterministic agent APIs for web and company intelligence, repository security, agent-work economics, machine-service discoverability, payment preflight and settlement proof, wallet context, and Morpho decision evidence. Pay per call through Base x402 or native MPP, with a Circle Gateway Nanopayments path for gasless batched USDC.

## Output

Returns a JSON object with byte sizes, token estimates, tool/operation counts, budget compliance flags, heaviest tools/operations, missing schema counts (titles, descriptions, input/output schemas), a 'decision' field (e.g. 'optimize'), and a list of actionable recommendations for improving the agent surface. Covers both MCP and OpenAPI surfaces independently with per-surface budget analysis.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "origin"
     ],
     "properties": {
      "origin": {
       "type": "string",
       "format": "uri",
       "description": "Credential-free public HTTPS service origin on port 443."
      },
      "mcpPath": {
       "type": "string",
       "default": "/mcp",
       "pattern": "^/[^/?#{}][^?#{}]*$",
       "description": "Exact root-relative MCP streamable-HTTP path."
      },
      "openApiPath": {
       "type": "string",
       "default": "/openapi.json",
       "pattern": "^/[^/?#{}][^?#{}]*$",
       "description": "Exact root-relative OpenAPI JSON path."
      },
      "surfaceMode": {
       "enum": [
        "mcp",
        "openapi",
        "both"
       ],
       "type": "string",
       "default": "both",
       "description": "Audit MCP only, OpenAPI only, or both. Unselected surfaces are not fetched or judged."
      },
      "mcpBudgetBytes": {
       "type": "integer",
       "default": 65536,
       "maximum": 1000000,
       "minimum": 8192
      },
      "openApiBudgetBytes": {
       "type": "integer",
       "default": 524288,
       "maximum": 1000000,
       "minimum": 32768
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "ok",
      "product",
      "version",
      "checkedAt",
      "decision",
      "request",
      "mcp",
      "openapi",
      "actions",
      "boundary"
     ],
     "properties": {
      "ok": {
       "type": "boolean"
      },
      "mcp": {
       "type": "object"
      },
      "actions": {
       "type": "array",
       "items": {
        "type": "string"
       }
      },
      "openapi": {
       "type": "object"
      },
      "product": {
       "type": "string",
       "const": "samedaydesk-agent-surface-budget-audit"
      },
      "request": {
       "type": "object"
      },
      "version": {
       "type": "string
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "mcp": {
   "bytes": 90000,
   "server": {
    "name": "example",
    "version": "1.0.0"
   },
   "available": true,
   "pageCount": 1,
   "requested": true,
   "toolCount": 20,
   "budgetBytes": 65536,
   "withinBudget": false,
   "heaviestTools": [],
   "selectionBytes": 87000,
   "protocolVersion": "2025-11-25",
   "missingTitleCount": 0,
   "missingDescriptionCount": 0,
   "missingInputSchemaCount": 0,
   "byteDerivedTokenEstimate": 22500,
   "missingOutputSchemaCount": 20
  },
  "actions": [
   "Add progressive MCP tool discovery or split the server into task-focused tool sets so clients do not ingest the full catalog every turn."
  ],
  "openapi": {
   "bytes": 300000,
   "available": true,
   "requested": true,
   "budgetBytes": 524288,
   "withinBudget": true,
   "operationCount": 25,
   "heaviestOperations": [],
   "missingOperationIdCount": 0,
   "byteDerivedTokenEstimate": 75000
  },
  "product": "samedaydesk-agent-surface-budget-audit",
  "request": {
   "origin": "https://agents.samedaydesk.com",
   "mcpPath": "/mcp",
   "openApiPath": "/openapi.json",
   "surfaceMode": "both",
   "mcpBudgetBytes": 65536,
   "openApiBudgetBytes": 524288
  },
  "version": "1.2.0",
  "boundary": {
   "toolsCalled": false,
   "credentialsUsed": false,
   "schemasRetained": false,
   "redirectsFollowed": false,
   "targetPaymentSent": false,
   "targetPaymentSigned": false,
   "tokenEstimateMethod": "ceil(UTF-8 bytes / 4); comparative estimate, not tokenizer billing",
   "responseBodiesReturned": false,
   "sessionIdentifiersReturned": false
  },
  "decision": "optimize",
  "checkedAt": "2026-08-12T15:00:00.000Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/samedaydesk-agent-surface-budget-audit-fc0f0d14/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.samedaydesk.com](https://www.zero.xyz/host/agents.samedaydesk.com/llms.txt)
