Skip to main content
Glama
harness

Harness MCP Server

Official
by harness

harness_diagnose

Read-only

Diagnose Harness pipeline failures and GitOps sync issues, test connectivity, and check resource health.

Instructions

Diagnose a Harness resource — analyze failures, test connectivity, check health, or troubleshoot GitOps sync issues. Defaults to pipeline execution diagnosis. Accepts a Harness URL to auto-detect the resource type. When a TYPESAFE_API_KEY is configured, pipeline failures additionally include an advisory "triage" field classifying each failed step (category: infra_flake, test_failure, config_error, dependency_failure, permission_error, timeout; plus confidence) — failure messages, delegate info, and fetched log snippets are sent to the configured TypeSafe API to produce it; the field is omitted when the key is absent, triage is disabled, or classification times out or is low-confidence.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoA Harness URL — resource type, org, project, and ID are extracted automatically
org_idNoOrganization identifier. Required for org- and project-scoped resources unless a Harness URL is passed. This session has no configured default (common in hosted/multi-user HTTP) — pass the current org_id on the first call. Do not omit it.
optionsNoResource-specific diagnostic options. Pipeline: execution_id, pipeline_id, summary, include_yaml, include_logs, include_all_step_logs (boolean, fetch logs for ALL steps not just failed/deepest — logs are fetched in batches of 3 for memory safety, capped at max_all_step_logs, use for pipeline summarization), max_all_step_logs (number, default 25, max steps to include in all_step_logs — prevents OOM on large matrix/loop pipelines), return_download_url (boolean, return signed logs.zip URLs instead of inline log text), log_snippet_lines, max_failed_steps. Pipeline diagnosis requires a completed execution. When a Harness URL contains ?step=<nodeExecutionId>, setting include_logs:true fetches that specific step's log regardless of pass/fail status and returns it as requested_step_log alongside any failed_step_logs. GitOps: agent_id. Call harness_describe for details.
project_idNoProject identifier. Required for project-scoped resources unless a Harness URL is passed. This session has no configured default (common in hosted/multi-user HTTP) — pass the current project_id on the first call. Do not omit it.
resource_idNoPrimary identifier of the resource (connector ID, delegate name). Auto-detected from url if provided.
resource_typeNoResource type to diagnose. Auto-detected from url if provided. Defaults to pipeline.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv3.2.22
    • changedInput schema / properties / org_id / description
      Previous value: -"Organization identifier (overrides default)"New value: +"Organization identifier. Required for org- and project-scoped resources unless a Harness URL is passed. This session has no configured default (common in hosted/multi-user HTTP) — pass the current org_id on the first call. Do not omit it."
    • changedInput schema / properties / project_id / description
      Previous value: -"Project identifier (overrides default)"New value: +"Project identifier. Required for project-scoped resources unless a Harness URL is passed. This session has no configured default (common in hosted/multi-user HTTP) — pass the current project_id on the first call. Do not omit it."
  2. Changed1 schema field changedv3.2.16
    • changedInput schema / properties / options / description
      Previous value: -"Resource-specific diagnostic options. Pipeline: execution_id, pipeline_id, summary, include_yaml, include_logs, return_download_url (boolean, return signed logs.zip URLs instead of inline log text), log_snippet_lines, max_failed_steps. Pipeline diagnosis requires a completed execution. When a Harness URL contains ?step=<nodeExecutionId>, setting include_logs:true fetches that specific step's log regardless of pass/fail status and returns it as requested_step_log alongside any failed_step_logs. GitOps: agent_id. Call harness_describe for details."New value: +"Resource-specific diagnostic options. Pipeline: execution_id, pipeline_id, summary, include_yaml, include_logs, include_all_step_logs (boolean, fetch logs for ALL steps not just failed/deepest — logs are fetched in batches of 3 for memory safety, capped at max_all_step_logs, use for pipeline summarization), max_all_step_logs (number, default 25, max steps to include in all_step_logs — prevents OOM on large matrix/loop pipelines), return_download_url (boolean, return signed logs.zip URLs instead of inline log text), log_snippet_lines, max_failed_steps. Pipeline diagnosis requires a completed execution. When a Harness URL contains ?step=<nodeExecutionId>, setting include_logs:true fetches that specific step's log regardless of pass/fail status and returns it as requested_step_log alongside any failed_step_logs. GitOps: agent_id. Call harness_describe for details."
  3. First observedv3.2.10

TDQS

A4.4/5.0
Behavior5/5

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

Given readOnlyHint=true and destructiveHint=false, the description adds substantial behavioral context: it discloses that failure data is sent to the TypeSafe API when a TYPESAFE_API_KEY is configured, explains how the triage field is omitted under various conditions, and details log fetching constraints (batching, caps, memory safety). This goes well beyond the annotations and is especially valuable for a diagnosis tool with external data-sharing behavior.

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?

The description is long but information-dense; every sentence contributes behavioral or usage detail that is not available in annotations or the schema. It is front-loaded with the core purpose and then layers conditional behaviors. It could be more structurally broken up for readability, but no content is redundant or filler.

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?

For a complex tool with six parameters, nested options, an enum, and an output schema, the description covers the essential behavioral conditions: default resource type, completed-execution requirement, triage enablement and omission, log batching and caps, and step-specific log retrieval. Combined with the rich input schema, the agent has enough context to invoke this tool correctly across the multiple supported resource types.

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 the input schema already documents each parameter thoroughly. The description reinforces key behaviors like URL auto-detection and pipeline defaulting, but most of the meaningful parameter detail, including options like include_all_step_logs and return_download_url, already lives in the schema. The description adds some high-level triage context but does not substantially extend 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 opens with a specific verb and resource ('Diagnose a Harness resource') and lists concrete diagnostic goals: analyze failures, test connectivity, check health, and troubleshoot GitOps sync issues. It also clearly states the default behavior (pipeline execution diagnosis) and URL-based auto-detection, which distinguishes it from sibling tools like harness_get and harness_status.

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?

The description provides clear context for when to use this tool ('analyze failures, test connectivity, check health, or troubleshoot GitOps sync issues') and notes it defaults to pipeline diagnosis. It does not explicitly name alternative sibling tools or state when not to use it, but it does reference harness_describe for option details, giving some routing guidance.

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