Skip to main content
Glama
liang04
by liang04

list_directory

Retrieve structured file listings from remote SSH directories to view contents, permissions, sizes, and modification times for efficient remote file management.

Instructions

获取远程目录的结构化文件列表

Args:
    remote_path: 远程目录路径,默认为当前目录 "."
    timeout: 操作超时时间(秒),默认30秒
    connection_name: SSH连接名称,如果不指定则使用默认连接

Returns:
    Dict包含目录列表结果:
    - success: 是否成功获取
    - path: 目录路径
    - files: 文件列表,每个文件包含:
        - name: 文件名
        - type: 类型 (file/directory/symlink/other)
        - size: 文件大小(字节,仅文件类型)
        - permissions: 权限字符串(如 "rwxr-xr-x")
        - modified_time: 修改时间(Unix时间戳)
        - owner_uid: 所有者UID
        - group_gid: 组GID
    - total_count: 文件总数
    - connection: 使用的连接名称
    - error: 错误信息(如果有)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
remote_pathNo.
timeoutNo
connection_nameNo
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses that this is a read operation (获取) with timeout control and SSH connection handling, but doesn't mention potential side effects (e.g., whether it caches results), authentication requirements, rate limits, or error handling beyond the return structure. The behavioral disclosure is basic but covers the core operation.

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 appropriately sized and well-structured with clear sections for Args and Returns. Every sentence adds value: the purpose statement is direct, parameter explanations are necessary, and return value documentation is comprehensive. Minor improvement could be front-loading more critical behavioral information.

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 3 parameters with no schema descriptions and no output schema, the description provides complete parameter semantics and detailed return value structure. It covers the essential context for a directory listing tool, though could benefit from mentioning SSH prerequisites or connection state requirements given the sibling tools context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully compensates by explaining all 3 parameters: remote_path (path to directory, default '.'), timeout (operation timeout in seconds, default 30), and connection_name (SSH connection name, default uses default connection). It adds crucial meaning beyond the bare schema, specifying defaults and usage context.

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 verb '获取' (get/retrieve) and resource '远程目录的结构化文件列表' (structured file list of remote directory), making the purpose specific and actionable. It distinguishes from siblings like download_file, upload_file, or execute_command by focusing solely on directory listing without file transfer or command execution.

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 description implies usage for retrieving remote directory contents via SSH, but doesn't explicitly state when to use this vs. alternatives like check_ssh_connection for connection testing or list_ssh_connections for connection management. It provides context through parameter defaults but lacks explicit guidance on tool selection scenarios.

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/liang04/ssh-mcp'

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