Skip to main content
Glama

diagnose_service

Find why a service failed: bundles deploy phase, crash forensics, fresh health probe, AI-readiness check, bounded log tail, and a remediation code to branch on instead of scraping logs.

Instructions

Use when: a service is failing and you need the reason, not the logs.

    Bundles the deploy phase, crash forensics (``last_exit_code``,
    ``oom_killed``), a fresh health probe, AI-binding readiness, a bounded
    log tail and a single ``remediation_code`` to branch on — call it after
    ``wait_for_service`` returns ``failed`` instead of scraping logs.
    Owner-or-admin read: the bundle carries env/secret key *names* and app
    log lines, never secret values.
    

Input Schema

NameRequiredDescriptionDefault
nameYesService name or job id of an existing service (app, model or database); both resolve to the same row.
log_tailNoLog lines bundled into the diagnosis. Default 50; clamped to [1, 200] here and again server-side.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

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 burden and does well: it declares this is an 'Owner-or-admin read', discloses exactly what sensitive data the bundle can expose (env/secret key *names*, app log lines) and what it never exposes (secret values), and notes the log tail is bounded. It stops short of saying whether the fresh health probe makes the call slow or what happens when the service has no deploy history.

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 an explicit 'Use when:' clause and only two further sentences, both of which add real routing or safety information. Slightly dense with reST-style double-backtick markup that reads as noise rather than signal.

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?

No output schema exists, and the description compensates by enumerating the bundle's return contents and flagging remediation_code as the branching field, plus the safety profile. An agent knows what it will get back and how to act on it.

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 coverage is 100%, so the two parameters are already fully documented including the default and the [1, 200] clamp. The description adds only the phrase 'bounded log tail', which is marginal value over the schema; 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+resource (diagnose a failing service) and enumerates exactly what the bundle contains: deploy phase, crash forensics, health probe, AI-binding readiness, log tail, remediation_code. This clearly separates it from service_logs and get_service, which an agent could otherwise confuse it with.

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 trigger ('Use when: a service is failing and you need the reason, not the logs'), explicit sequencing ('call it after wait_for_service returns failed'), and an explicit anti-pattern to avoid ('instead of scraping logs'). That is a when/when-not/alternative triad.

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