Skip to main content
Glama

count_sections

Read-only

Count doc sections by filters like path glob, roles, tags, and level or size. Returns just the count, useful for UI counters and 'does anything match?' probes.

Instructions

v1.59+ — count sections matching the same filter set as search_sections (path_glob, role/roles/exclude_roles, tags/exclude_tags, min/max_level, min/max_byte_length) but skip ranking. Use for UI counters or 'does anything match?' probes. Returns the count only, never the matching sections.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repoYes
roleNo
tagsNo
rolesNo
doc_pathNo
max_levelNo
min_levelNo
path_globNo
exclude_tagsNo
exclude_rolesNo
max_byte_lengthNo
min_byte_lengthNo
Behavior4/5

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

Annotations only declare readOnlyHint=true. The description adds valuable behavioral context: 'Returns the count only, never the matching sections,' clarifying return behavior and reinforcing the read-only nature. It doesn't contradict annotations but could mention what happens with no matches or errors, though not essential.

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 a single, information-dense sentence. It includes the version, purpose, filter list, usage guidance, and return behavior without any fluff. Every phrase earns its place.

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?

Despite having no output schema and readOnlyHint only, the description provides a complete picture: what it does, the filters, the use cases, and the exact return value. For a simple count tool with 12 params and zero schema coverage, this is exemplary.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It lists and groups parameters ('path_glob, role/roles/exclude_roles, tags/exclude_tags, min/max_level, min/max_byte_length') and refers to search_sections for context, but doesn't detail each parameter's exact format or behavior. This adds meaning beyond the raw schema.

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 'count sections matching the same filter set as search_sections' with a specific verb and resource, and distinguishes it from the sibling tool by noting 'skip ranking.' This explicitly differentiates it from search_sections and other related tools.

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?

Explicitly states when to use: 'Use for UI counters or "does anything match?" probes.' It also implies when not to use (when ranking is needed) by the contrast with search_sections, and names the alternative tool explicitly.

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/jgravelle/jdocmunch-mcp'

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