Skip to main content
Glama

EMQX Rule Metrics

emqx_get_rule_metrics
Read-onlyIdempotent

Check rule traffic by retrieving match, pass, and failure counters. If matched=0, the rule's topic filter isn't receiving published messages.

Instructions

Match, pass and failure counters for one rule.

A rule with matched=0 is not seeing traffic — usually its FROM topic filter does not match what devices actually publish.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rule_idYesRule id as listed by emqx_list_rules.

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, idempotentHint=true, and destructiveHint=false, so the safety profile is covered. The description adds interpretive value beyond annotations by explaining what matched=0 means, helping the agent reason about rule health. No contradictions or missing safety-relevant behavior.

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 compact and well-structured: one sentence defines the output, and a second sentence offers a practical interpretation tip. Every word earns its place with no fluff or repetition of schema/annotation content.

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 single-parameter, read-only metrics tool with an output schema present, the description is sufficiently complete. It conveys what the counters are and how to interpret a common edge case, so an agent can confidently select and invoke the tool without additional documentation.

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?

The input schema provides 100% coverage for the single parameter rule_id, including a cross-reference to emqx_list_rules. The description adds no additional parameter-level detail, so it does not exceed the schema baseline.

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?

The description clearly states that the tool returns match, pass, and failure counters for a single rule, which distinguishes it from broader EMQX metrics tools or rule listing tools. It lacks an explicit verb like 'get' but the noun-phrase style is unambiguous and specific.

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 explains a key diagnostic use case: a rule with matched=0 indicates no matching traffic, likely due to a FROM topic filter mismatch. This provides useful context for when to inspect metrics, though it does not explicitly exclude alternatives or name sibling tools.

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/WOOWTECH/Woow_emqx_mcp_server'

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