Skip to main content
Glama

Count words

wordcount
Read-only

Counts the words in a compiled LaTeX project, including the root file and its input/include graph while excluding commands and comments; use it to answer document-length questions accurately.

Instructions

Word count of the document as it compiles — the root file plus its \input/\include graph, commands and comments excluded: {rootFile, total, files}. Use it for length questions instead of estimating from source. A project with no main document yet is an error, not a count of 0.

Input Schema

NameRequiredDescriptionDefault
branchNoBranch name (defaults to 'main'). Every result, error results included, echoes {branch, head} — head is the branch's current commit (after a write, the commit that write made). Pass the branch explicitly whenever you are not on main.
projectNoProject id. Optional when the access token is scoped to exactly one project.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the readOnly/openWorld annotations, it discloses what is counted and excluded (commands, comments, included files), that results come from compilation, and the error contract for a project with no main document — exactly the failure mode an agent would otherwise misread as a zero count.

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?

Two dense sentences, front-loaded with the counting definition, then the usage direction and the error caveat. No filler, and every clause carries distinct information.

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?

With no output schema, the description voluntarily supplies the return field list and the failure semantics, and the parameters are fully covered by the schema. Nothing an agent needs to invoke or interpret this call correctly is missing.

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 branch and project are already documented, including the {branch, head} echo behavior. The description adds no further parameter meaning, so the baseline 3 applies.

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?

Names a specific verb+resource (word count of the document) and pins the exact scope — root file plus \input/\include graph, commands and comments excluded — plus the return shape {rootFile, total, files}. No sibling competes for this job, and an agent can tell instantly what it computes.

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?

"Use it for length questions instead of estimating from source" gives an explicit use condition and rules out the obvious wrong approach. It also pre-empts the ambiguous case (no main document is an error, not 0). No named sibling alternative is needed since none exists, but the guidance is clear rather than exhaustive.

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