Skip to main content
Glama

count_lines_file

Count lines in a file from its absolute path. Uses splitlines semantics, so a trailing newline adds no empty line.

Instructions

Count lines in a file (str.splitlines semantics: a trailing newline adds no empty line).

Args:
    file_path: Absolute path to the file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Install Server

TDQS

A4/5.0
Behavior4/5

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

There are no annotations, so the description carries the behavioral disclosure burden. It usefully discloses splitlines semantics, including the trailing-newline edge case, and requires an absolute path. It does not mention error or encoding behavior, but for a simple read-only counting tool the stated behavior is meaningful.

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 extremely concise, front-loads the critical semantic rule, and includes only a single necessary parameter explanation. Every sentence earns its place.

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?

Given the tool's simplicity, an existing output schema, and the disclosure of the important splitlines behavior, an agent has enough information to call it correctly. Minor gaps remain around when to choose it over sibling tools and how errors are reported, but these are not blocking for this tool.

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?

The schema provides no description coverage, but the description's args section defines file_path as "Absolute path to the file," adding a real constraint beyond the schema's bare string type. This adequately compensates for the schema gap for a single-parameter tool.

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?

"Count lines in a file" states a specific verb, resource, and metric. The added splitlines semantics further disambiguates exactly what is counted, and the tool name and siblings make the distinction from count_tokens_file and count_chars_file clear.

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?

The description gives no explicit guidance on when to select this tool over sibling tools such as count_tokens_file or count_chars_file. Usage is only implied by the name and purpose, with no mention of alternatives or exclusions.

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

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/the-phase-space/tokenizer-mcp'

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