Skip to main content
Glama
techskies11

datadog-mcp

by techskies11

count_logs

Read-onlyIdempotent

Count log events matching a query without fetching all data. Get a numeric answer for questions like 'how many errors happened?'

Instructions

Count logs matching a query WITHOUT fetching all data (fast & lightweight).

PREFERRED for counting events - much faster than search_logs, which should never be used just to count results.

Use this when:

  • "How many errors happened?"

  • "Count logs for a service"

  • Need a number, not log content

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query using Datadog log search syntax (e.g. "status:error service:api")
indexesNoOptional list of index names to search (e.g. ["main", "retention"])
to_timeYesEnd time - same accepted formats as from_time
from_timeYesStart time - ISO 8601, relative date math (e.g. "now-1h"), or a millisecond timestamp

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and idempotentHint=true. The description adds valuable behavioral context by stating it counts 'WITHOUT fetching all data' and is 'fast & lightweight,' which goes beyond the annotations. It does not mention rate limits or exact count semantics, but that is not critical here.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, front-loaded with the core purpose, and uses bullet points for use cases. Every sentence adds value, with no wasted words.

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?

Given the simple 4-parameter schema, the presence of an output schema, and full annotation coverage, the description provides enough context. It explains the tool's advantage over search_logs, typical use cases, and that it returns a count rather than log content.

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%, and each parameter (query, indexes, from_time, to_time) has a clear description in the schema. The tool description itself does not add parameter-level detail beyond what the schema already provides, so it meets the baseline but does not exceed it.

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 clearly states the tool counts logs matching a query without fetching all data, using a specific verb and resource. It explicitly distinguishes itself from search_logs, which is a sibling tool, by emphasizing it is for counting rather than retrieving 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?

Provides explicit guidance on when to use this tool, including specific use cases like "How many errors happened?" and "Count logs for a service." It also gives a clear exclusion: search_logs should never be used just to count results, making the alternative explicit.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/techskies11/datadog-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server