Skip to main content
Glama

Subscriber trace

trace_subscriber
Read-onlyIdempotent

Build one time-ordered, multi-protocol timeline for a subscriber by IMSI or MSISDN across Diameter, GTP, PFCP, MAP and SIP, pairing requests with answers to diagnose why a subscriber failed.

Instructions

Build one time-ordered timeline for a subscriber across Diameter (User-Name), GTPv2-C and GTPv1-C (IMSI/MSISDN IEs, then following the control-plane TEIDs), PFCP (sessions naming the IMSI or a UE address the GTP rows allocated, followed by SEID), MAP (IMSI/MSISDN) and SIP (From/To/P-Asserted-Identity containing the MSISDN). Each row carries the protocol, message name, result (Result-Code, GTP cause, SIP final status), peers and the request/answer pairing including unanswered: true. Give imsi, msisdn or both as digit strings. The whole call shares one time budget (the per-run timeout); when it runs out the timeline found so far is returned with truncated and the pass that stopped marked timed_out. GTP rows carry the proxy-chain fields of gtp_sessions (chain, leg_without_response, near_capture_end, duplicate_of_frame, note); unanswered Diameter and GTP rows the capture stopped too soon after get near_capture_end, counted in unanswered_near_capture_end. Start here for "why did subscriber X fail" questions.

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": {
      "path": "<path>"
    },
    "name": "trace_subscriber"
  }
}

Input Schema

NameRequiredDescriptionDefault
endNoSame forms as start
imsiNoIMSI, 6 to 15 digits
pathYesCapture file (absolute, in an allowed dir) or open_capture handle
limitNoMost rows per page
startNoISO 8601, epoch s, +Ns from start, -Ns from end
msisdnNoMSISDN (E.164 digits, no +)
offsetNoRows to skip (next_offset)
outputNosummary: all but rows, plus 3 rows (<8 KB)rows
redactNoReplace subscriber identifiers in this result with tokens; ids+ips hides every IP toooff
columnsNoRow keys to keep (frame keys stay)
esp_nullNoRead SIP in NULL-encrypted ESP
max_output_kbNoLower output cap, KB

Output Schema

NameRequiredDescriptionDefault
countNo
errorNo
ipsecNokeys: esp_packets, spis, decoded_null, unreadable, esp_null, hint
offsetNo
passesNo
windowNo
droppedNo
failuresNo
has_moreNo
identityNokeys: imsi, msisdn
returnedNo
timelineNorows with keys: time, protocol, message, detail, result, identity, src, dst, request_frame, answer_frame, frame, rtt_ms, unanswered, failed, leg_without_response, near_capture_end, duplicate_of_frame, chain, note
by_protocolNo
next_offsetNo
total_foundNo
total_matchedNo
packets_matchedNo
packets_scannedNo
total_is_lower_boundNo
unanswered_near_capture_endNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered. The description adds real behavioral context beyond that — the shared time budget, `truncated`, the `timed_out` pass marker, `unanswered: true` pairing, `near_capture_end` accounting and propagation of gtp_sessions proxy-chain fields. It is dense, useful disclosure that the structured fields do not carry.

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?

Front-loaded with the core action and the protocol correlation logic, then the identifier requirement, then the operational caveats (truncation, near-capture-end) and finally the routing pointer. It is long but every clause carries information; the proxy-chain field enumeration is the only passage that reads as bulk carried over from gtp_sessions.

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

Completeness4/5

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

Given a 12-parameter tool with an output schema and full annotation coverage, the description covers traversal logic, identifier inputs, truncation behavior and the meaning of the special row flags — enough for an agent to call it correctly and interpret the result. It leaves nuance like pagination interaction with `limit`/`offset` to the schema, which is acceptable since an output schema exists.

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?

With schema description coverage at 100% and 12 well-documented parameters, the schema does the heavy lifting, so baseline 3 applies. The description only adds the either/or meaning of `imsi` and `msisdn` ("both as digit strings"), while `start`/`end`, `limit`, `offset`, `output`, `redact` and `columns` are left entirely to the schema.

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 concrete verb and resource ("Build one time-ordered timeline for a subscriber") and enumerates exactly which protocols and identifiers are correlated, so an agent can distinguish it from single-protocol siblings such as diameter_sessions, gtp_sessions or sip_dialogs. The closing line "Start here for 'why did subscriber X fail' questions" anchors the intent unambiguously.

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

Usage Guidelines4/5

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

"Start here for 'why did subscriber X fail' questions" gives a clear positive trigger, and "Give `imsi`, `msisdn` or both" tells the agent what must be supplied to make the call work. It does not name any alternative to use instead (e.g. when a single-protocol tool suffices), so the when-not side is missing, but the positive routing is explicit.

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