Skip to main content
Glama

IA-QA — 152 QA & Dev Tools for AI Agents

count_code_lines

Read-onlyIdempotent

Count lines of code: total, code lines, comment lines, blank lines, and comment density. Supports JS/TS, Python, Java/C/C++, Ruby, Go, Shell, HTML/XML, and CSS.

Input Schema

NameRequiredDescriptionDefault
inputYesSource code to analyze
languageNoLanguage hint: "js", "ts", "py", "java", "c", "rb", "go", "sh", "html", "css" (auto-detect if omitted)

Output Schema

NameRequiredDescriptionDefault
languageNo
code_linesNo
blank_linesNo
total_linesNo
comment_linesNo
comment_densityNo
code_to_comment_ratioNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "input": "// c\nconst a = 1; // x\n\n/* b\n c */\nlet b;",
      +    "language": "javascript"
      +  }
      +]
  2. Changed1 schema field changed
    • addedOutput schema / properties
      Added value: +{
      +  "blank_lines": {},
      +  "code_lines": {},
      +  "code_to_comment_ratio": {
      +    "type": "string"
      +  },
      +  "comment_density": {},
      +  "comment_lines": {},
      +  "language": {},
      +  "total_lines": {}
      +}
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "type": "object"
      +}
  4. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare read-only, idempotent, non-destructive, closed-world behavior, so the bar is lower. The description adds genuinely new behavioral context: the tool is language-aware and understands comment syntax for nine language families, which is why its output differs from naive line counting. It omits only minor details such as auto-detection fallback behavior (though the schema covers that).

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 sentences, zero filler: the first lists what is measured, the second lists supported inputs. Both are front-loaded and every clause carries information.

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

Completeness4/5

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

With an output schema present and annotations covering the safety profile, the description needn't explain return values. Parameters are fully documented in schema. The only real gap is disambiguation from text_stats, a same-family sibling with overlapping purpose.

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 100%, so baseline is 3. The description adds value by spelling out the supported language families by full name (JS/TS, Python, Java/C/C++, Ruby, Go, Shell, HTML/XML, CSS), which clarifies the abbreviated enum-less hints in the schema.

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?

Names a specific verb ('Count') and resource ('lines of code') and enumerates exactly what is produced: total, code, comment, blank lines, plus comment density. It is clearly a code-specific line counter, but never distinguishes itself from the sibling text_stats, which an agent could easily confuse it with.

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

Usage Guidelines3/5

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

Usage is implied by the domain (use it on source code), but there is no explicit 'use this when' statement or mention of the closest alternative, text_stats. The agent must infer the boundary itself.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.