Skip to main content
Glama

tail

Read-only

Return the last N lines from files or stdin as JSON (default 10). View recent file additions or check log tails. Supports negative N to skip first lines.

Instructions

Return the last N lines (default 10) of files or stdin as JSON. Read-only, no side effects. Returns JSON with line array by default; use --raw for plain text. Supports negative-N to skip the first N lines. Use to view recent file additions or check log tails. Not for viewing file beginnings — use 'head'. See also 'head', 'cat'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rawNoWrite raw selected lines without a JSON envelope.
pathYesFile to read.
linesNoNumber of lines.
encodingNoText encoding (default: utf-8). Use 'auto' for BOM/autodetection.utf-8
show_encodingNoInclude encoding detection metadata in JSON result.
encoding_errorsNoHow to handle encoding errors (default: replace).replace
encoding_profileNoLocale-aware encoding fallback profile for auto-detection.
Behavior5/5

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

Beyond the annotation 'readOnlyHint: true', the description adds that it reads files or stdin, returns JSON by default with a raw mode option, supports negative-N to skip first lines, and has no side effects. This fully discloses behavior.

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 5 sentences, front-loaded with the core purpose and output format, then additional features, usage guidance, and alternatives. Every sentence is informative and no redundancy.

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 7 parameters and no output schema, the description compensates by explaining the output format (JSON, raw), input sources (files, stdin), and use cases. It covers key behavioral aspects, making it complete for an agent to determine suitability.

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 covers 100% of parameters, so baseline is 3. The description adds value by explaining the negative-N feature for the 'lines' parameter (not in schema) and mention of '--raw' for the 'raw' parameter, enhancing understanding beyond the 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 the tool returns the last N lines of files or stdin as JSON, specifies default behavior (10 lines), and distinguishes from siblings by explicitly noting it is not for file beginnings and referencing 'head' and 'cat'.

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?

The description provides explicit usage context: 'Use to view recent file additions or check log tails' and when not to use: 'Not for viewing file beginnings — use 'head'.' It also directs to alternatives with 'See also 'head', 'cat'.'

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/caseSHY/AI-CLI'

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