Skip to main content
Glama

test

Read-only

Evaluate file properties like existence, type, and permissions, returning JSON boolean for conditional scripting.

Instructions

Evaluate file predicates (exists, is_file, is_dir, is_executable, is_symlink, is_readable, is_writable) and return structured JSON with the boolean result. Read-only, no side effects. Returns JSON indicating test result and exit code (0 for true, 1 for false). Use for conditional branching based on file properties in scripts. Not for detailed file inspection — use 'stat' for full metadata. See also 'stat', '['.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
directoryNoPath is a directory.
emptyNoPath is an empty regular file.
executableNoPath is executable.
existsNoPath exists. This is the default predicate.
exit_codeNoReturn exit code 1 when predicates do not match.
fileNoPath is a regular file.
non_emptyNoPath is a non-empty regular file.
pathYesPath to test.
readableNoPath is readable.
symlinkNoPath is a symbolic link.
writableNoPath is writable.
Behavior5/5

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

The description notes 'Read-only, no side effects' and explains the return format (JSON with result and exit code). This adds value beyond annotations which only declare readOnlyHint=true, making the tool's behavior fully transparent.

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 four sentences with no filler. It front-loads the core action and return type, then provides usage context. Every sentence serves a purpose.

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?

For a tool with no output schema, the description explains the return shape (JSON with result and exit code). It covers all predicates, side-effect safety, and usage recommendations, making it complete for its complexity.

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 coverage is 100% with descriptions for all 11 parameters. The description lists the supported predicates but does not add significant meaning beyond the schema. It is adequate but not exceptional.

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 evaluates file predicates (exists, is_file, etc.) and returns structured JSON. It explicitly distinguishes itself from sibling tools like 'stat' and '[' by noting it is for conditional branching, not detailed inspection.

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 when-to-use (conditional branching) and when-not-to-use (use 'stat' for full metadata), and references alternatives ('['). This gives clear guidance for tool selection.

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