Skip to main content
Glama

debug_last_request

Inspect the most recent captured HTTP request log for a mock endpoint and generate a step-by-step Rule Engine diagnostic trace in Markdown. The trace displays the incoming request's method, path, timestamp, headers, body, final HTTP status code, matched outcome (Rule '' or Fallback), and an ordered evaluation breakdown of every rule configured on the mock (sorted by ascending priority) showing each rule's conditions, join operators, and whether it fired ('[MATCHED]') or was skipped/failed ('[DID NOT MATCH]'). If no request logs exist for the mock yet, returns an informational prompt to send a request via test_mock first. USAGE GUIDELINES: Call debug_last_request immediately when test_mock returns an unexpected status code, when the 'X-Rule-Matched' header is missing or shows the wrong rule, or when diagnosing why an incoming request fell back to the default response. To inspect multiple historical requests rather than just the latest one, use get_request_logs.

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": {
      "projectId": "<projectId>",
      "mockId": "<mockId>"
    },
    "name": "debug_last_request"
  }
}

Input Schema

NameRequiredDescriptionDefault
mockIdYesDatabase ID of the mock API endpoint to diagnose (obtain from list_mocks, search_mocks, or get_mock_detail).
projectIdYesDatabase ID of the project workspace containing the mock (obtain from list_projects, list_mocks, or search_mocks).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / mockId / description
      Previous value: -"Mock API endpoint ID"New value: +"Database ID of the mock API endpoint to diagnose (obtain from list_mocks, search_mocks, or get_mock_detail)."
    • changedInput schema / properties / projectId / description
      Previous value: -"Project ID"New value: +"Database ID of the project workspace containing the mock (obtain from list_projects, list_mocks, or search_mocks)."
  2. First observed

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the output format, the fields shown (method, path, timestamp, headers, body, status, matched outcome), the ordering by ascending priority, and the MATCHED/DID NOT MATCH markers. It also covers the empty-state behavior (informational prompt to send a request via test_mock). It falls short only in not explicitly stating the call is read-only and side-effect-free.

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?

Purpose and output shape are front-loaded, and the USAGE GUIDELINES block separates routing guidance cleanly. The main body is one very long sentence enumerating trace fields, which is dense but each element informs the agent about the return value.

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?

There is no output schema, so the description must explain returns, and it does thoroughly: trace contents, ordering, match annotations, and the no-logs case. Combined with full schema coverage on the two parameters, an agent has everything needed to call it and interpret results.

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 both projectId and mockId are already well documented in the schema, including where to obtain them. The description adds no further parameter meaning, so the baseline 3 applies.

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?

States a specific verb and resource ('Inspect the most recent captured HTTP request log for a mock endpoint') plus the produced artifact ('step-by-step Rule Engine diagnostic trace in Markdown'). It is clearly distinguishable from siblings by naming the latest-request scope and the rule-evaluation trace content.

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

Usage Guidelines5/5

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

Explicit triggers are given: call it when test_mock returns an unexpected status, when 'X-Rule-Matched' is missing or wrong, or when a request unexpectedly fell back. It also names the alternative, get_request_logs, and the exact condition (multiple historical requests) that selects it.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources