Skip to main content
Glama

cbh__CountInstancesByTag

Counts instances that match specified tag conditions, including all/any tag and exclusion filters, to help quantify tagged resources within a project.

Instructions

[CBH] 统计符合标签条件的实例数量。

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "project_id": "<project_id>"
    },
    "name": "cbh__CountInstancesByTag"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagsNo包含标签,最多包含50个key,每个key下面的value最多10个,每个key对应的value可以为空数组但结构体不能缺失。
matchesNo搜索字段,key为要匹配的字段,如resource_name等。
not_tagsNo不包含标签,最多包含50个key,每个key下面的value最多10个, 每个key对应的value可以为空数组但结构体不能缺失。Key不能重复,同一个key中values不能重复。
sys_tagsNo仅op_service权限可以使用此字段做资源实例过滤条件。
tags_anyNo包含任意标签,最多包含50个key,每个key下面的value最多10个,每个key对应的value可以为空数组但结构体不能缺失。Key不能重复,同一个key中values不能重复。
project_idYes项目ID。
not_tags_anyNo不包含任意标签,最多包含50个key,每个key下面的value最多10个, 每个key对应的value可以为空数组但结构体不能缺失。Key不能重复,同一个key中values不能重复。
without_any_tagNo不包含任意一个标签,该字段为true时查询所有不带标签的资源。

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

C2.2/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full burden, and it discloses almost nothing. It does not explain the interplay of tags/not_tags/tags_any/not_tags_any/without_any_tag, the op_service-only restriction on sys_tags, whether an empty filter counts everything, or what the response contains. Only the bare fact that it is an aggregation read can be inferred.

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

Conciseness3/5

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

It is a single short sentence with no waste, but its brevity comes from under-specification rather than disciplined editing. There is no structure to front-load because there is essentially no content.

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

Completeness1/5

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

Eight parameters, a five-way tag filter with subtle boolean semantics, no annotations, and no output schema — yet the description is one clause. Nothing an agent needs to invoke this correctly (filter combination rules, permission constraints on sys_tags, what the count covers) is provided.

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 all eight parameters are documented in the schema, including the tag filter semantics and the sys_tags permission note. The description adds no meaning beyond that, which meets the baseline of 3 but earns nothing more.

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

Purpose2/5

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

The description is essentially a Chinese restatement of the tool name: 'count instances matching tag conditions.' It gives no scope, no distinction from the sibling cbh__ListInstancesByTag, and no indication of what the count applies to (project, all instances, filtered set). An agent learns nothing it could not infer from the name alone.

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

Usage Guidelines2/5

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

No when-to-use guidance is present. The definition never says to prefer this over cbh__ListInstancesByTag when only a total is needed, nor does it mention the cost/behavior tradeoff of counting versus listing. Usage is left entirely to inference.

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

Deploy Server

Other Tools