Skip to main content
Glama

ssh_list_credentials

View all stored SSH credentials for managing secure remote server connections and authentication methods.

Instructions

List all saved SSH credentials

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that parses empty input schema, retrieves all stored credentials from the in-memory Map, formats a safe list (hiding sensitive data like passwords/keys), and returns a text response listing available credentials with metadata.
    private async handleListCredentials(args: unknown) {
      ListCredentialsSchema.parse(args);
      
      const credentials = Array.from(credentialStore.entries()).map(([id, cred]) => ({
        credentialId: id,
        host: cred.host,
        port: cred.port,
        username: cred.username,
        hasPassword: !!cred.password,
        hasPrivateKey: !!cred.privateKeyPath,
        createdAt: cred.createdAt,
        lastUsed: cred.lastUsed
      }));
    
      return {
        content: [
          {
            type: 'text',
            text: credentials.length > 0 
              ? `Saved credentials:\n${credentials.map(c => 
                  `- ${c.credentialId}: ${c.username}@${c.host}:${c.port} (${c.hasPassword ? 'password' : 'key'}) - Last used: ${c.lastUsed}`
                ).join('\n')}`
              : 'No saved credentials found',
          },
        ],
      };
    }
  • Zod schema for tool input validation. Defines an empty object since the tool requires no parameters.
    const ListCredentialsSchema = z.object({});
  • src/index.ts:388-396 (registration)
    Tool metadata registration in the ListToolsRequestHandler response. Specifies the tool name, description, and JSON input schema advertised to clients.
    {
      name: 'ssh_list_credentials',
      description: 'List all saved SSH credentials',
      inputSchema: {
        type: 'object',
        properties: {},
        required: []
      },
    },
  • src/index.ts:507-508 (registration)
    Dispatch registration in the CallToolRequestHandler switch statement, mapping tool name to the handler method.
    case 'ssh_list_credentials':
      return await this.handleListCredentials(args);
  • In-memory Map storing SSH credentials by ID, used by the handler to list credentials. Defined globally in the module.
    const credentialStore = new Map<string, StoredCredential>();
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't describe how it behaves: it doesn't mention output format (e.g., list structure, credential details), potential errors (e.g., if no credentials exist), or security implications (e.g., whether passwords are masked). This leaves significant gaps for a tool handling sensitive data.

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, efficient sentence that directly states the tool's purpose with no unnecessary words. It's front-loaded and perfectly sized for a simple list operation.

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?

Given the tool's complexity (handling sensitive SSH credentials) and the lack of annotations and output schema, the description is incomplete. It doesn't explain what information is returned (e.g., credential names, hosts, usernames), how to interpret the output, or any behavioral nuances, leaving the agent with insufficient context.

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 tool has zero parameters, and schema description coverage is 100%, so there's no need for parameter documentation in the description. The baseline for zero parameters is 4, as the description appropriately doesn't waste space on non-existent parameters.

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 clearly states the verb ('List') and resource ('all saved SSH credentials'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'ssh_save_credential' or 'ssh_delete_credential' beyond the obvious list vs. modify distinction, which prevents a perfect score.

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. It doesn't mention prerequisites (e.g., needing saved credentials first), related tools like 'ssh_connect_with_credential', or scenarios where listing credentials is appropriate versus directly connecting.

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

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