Skip to main content
Glama
danduh

MCP Security Server

by danduh

count_lines_in_file

Count the number of lines in a text file and retrieve its metadata. Use to quickly assess file size or verify file integrity during security audits.

Instructions

Count the number of lines in a text file and return file metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesPath to the file to count lines in

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description carries the burden of behavioral disclosure. The verb 'Count' and 'return' imply a read-only operation, which is a useful behavioral signal, but it does not explicitly state that the file is not modified or describe what 'file metadata' includes.

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, directly worded sentence with no fluff or repetition. The action is front-loaded, making it immediately clear what the tool does.

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

Completeness2/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 should explain what the tool returns, but it only vaguely mentions 'file metadata'. There is no indication of line-count handling details, error behavior, or whether the metadata includes fields like file size or modification time.

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 the schema already documents the single file_path parameter. The description adds no additional semantic detail beyond what the schema provides, so the baseline score of 3 is appropriate.

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?

The description states a specific verb ('Count') and resource ('number of lines in a text file'), and adds that it returns file metadata. This clearly identifies what the tool does, and it is distinguishable from siblings like write_to_file, though it does not explicitly contrast itself with read_file_content.

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 provides no guidance on when to use this tool versus alternatives such as read_file_content. There is no mention of scenarios like 'when you only need a line count' or exclusions for binary files or large files.

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