Skip to main content
Glama

file_exists

Check if a file or directory exists at a given path, returning true or false to support conditional operations.

Instructions

Check if a file or directory exists at the specified path. Returns true if exists, false otherwise. Useful for conditional operations. / 检查指定路径的文件或目录是否存在。存在返回 true,否则返回 false。用于条件操作。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesThe path to check for existence. Can be a file or directory path.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
existsYes
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool checks both files and directories and returns a boolean, which covers the core behavior. However, it does not mention edge cases like symlinks, permission errors, or whether the path must be normalized, leaving some behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with two sentences followed by a bilingual translation. The English part is front-loaded and efficient, though the Chinese duplicate adds slight redundancy. Overall, it is appropriately sized with no wasted words.

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 simple nature of the tool (one parameter, boolean output schema), the description adequately covers the input, output behavior, and a usage context. No further details are strictly necessary for an agent to use this tool correctly.

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?

The schema description covers 100% of the parameter with examples and a clear definition. The description only repeats 'specified path' without adding additional semantics, so it meets the baseline but adds no extra value 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 uses a specific verb 'Check if' with an explicit resource 'file or directory' and path parameter. It clearly states the return value (true/false) and distinguishes itself from siblings by focusing solely on existence checking, unlike file_stat or search_files.

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?

The phrase 'Useful for conditional operations' provides some context for when to use the tool, but it does not explicitly mention alternatives or when not to use it. Sibling tools like file_stat could potentially serve similar purposes, and no exclusions are given.

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/shibingli/mcp-toolkit'

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