Skip to main content
Glama
raviraj-ntp

Dynatrace MCP

by raviraj-ntp

Surrounding Logs

dynatrace_logs_surrounding

Fetches log lines before and after a pivot timestamp for the same pod or container, providing context to debug incidents and understand event sequences.

Instructions

Lines around a pivot timestamp for the same pod/container (grep -C in time). before/after default 30s, max 5m.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoEnd: now or ISO-8601
podNoPod name: exact replica, prefix ending with '-', or glob (my-app-*).
fromNoStart: now-30m or ISO-8601
hostNohost.name
nodeNok8s.node.name
podsNoOne or more pod names (same matching rules as pod)
sortNo
afterNoe.g. 30s
limitNo
pivotYesISO timestamp of a matching log line
regexNo
aroundNoPivot timestamp for a window
beforeNoe.g. 30s
offsetNo
sampleNoKeep 1 in N lines
spanIdNo
statusNo
windowNoHalf-window around pivot, e.g. 2m
clusterNoDynatrace k8s.cluster.name. Discover with dynatrace_list_clusters; do not assume a cluster.
endDateNoCalendar end YYYY-MM-DD (UTC day)
serviceNoservice.name / dt.entity.service
traceIdNo
containsNo
entityIdNoDynatrace entity id if known
loglevelNoERROR,WARN or array
workloadNoWorkload or deployment name (k8s.workload.name / k8s.deployment.name).
containerNok8s.container.name
namespaceNoKubernetes namespace (k8s.namespace.name). Discover with dynatrace_list_namespaces.
startDateNoCalendar start YYYY-MM-DD (UTC day)
connectionNoNamed connection from env (default, optional stage/prod aliases, or a DYNATRACE_CONNECTIONS key)
containsAllNo
containsAnyNo
notContainsNo
excludeLevelsNo
allowLongRangeNoAllow ranges longer than the default cap
caseInsensitiveNo
excludePatternsNo
maxContentCharsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.3/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It usefully discloses defaults (before/after = 30s) and a hard cap (max 5m), plus the pod/container scoping constraint. It says nothing about pagination, the limit=200 cap, or range-cap behavior implied by allowLongRange, leaving meaningful behavioral gaps.

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?

Two compact clauses, front-loaded with the core behavior, and every word earns its place. It is arguably too terse for a 38-parameter tool, which keeps it just short of a 5.

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

Completeness2/5

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

For a high-complexity tool with 38 parameters, no annotations, no output schema, and only 61% schema coverage, the description is thin. It never explains how pivot/window/around/from/to interact, how limit/offset/sample paginate, or what a surrounding-lines response looks like.

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?

Coverage is 61%, so the schema documents much of the surface already. The description adds real value only for before/after (defaults and 5m max), which the schema does not state; the other 36 parameters (pods, cluster, namespace, window, around, allowLongRange) get no added meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Lines around a pivot timestamp') scoped to 'the same pod/container', and the 'grep -C in time' analogy pins down the semantics precisely. It does not name any sibling tool, but the pivot-window concept is distinct from search_logs/pod_logs/logs_tail so an agent can discriminate.

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

Usage Guidelines3/5

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

The pivot-timestamp framing implies you need an existing anchor log line, which is implicit when-to-use guidance. However there is no explicit statement of when to prefer this over dynatrace_search_logs, dynatrace_pod_logs, or dynatrace_logs_tail, and no prerequisites are given.

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