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>();

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('List') but doesn't describe what 'saved SSH credentials' entails (e.g., format, scope like user/system-wide), potential side effects (e.g., if listing exposes sensitive data), or output behavior (e.g., pagination, error handling). For a tool with zero annotation coverage, this leaves significant gaps.

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 ('List all saved SSH credentials') that directly conveys the core functionality without any wasted words. It is appropriately sized and front-loaded, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (0 parameters, no output schema, no annotations), the description is minimally adequate. It states what the tool does but lacks details on behavior, output format, or usage context. For a simple list operation, this might suffice, but it doesn't provide a complete picture for an agent to use it effectively without additional assumptions.

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 input schema has 0 parameters with 100% coverage, so the schema fully documents the absence of inputs. The description doesn't need to add parameter details, and it correctly implies no parameters are required by not mentioning any. This meets the baseline for tools with no 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 'List all saved SSH credentials' clearly states the verb ('List') and resource ('saved SSH credentials'), making the tool's purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'ssh_save_credential' or 'ssh_delete_credential' beyond the obvious action difference, which is why it doesn't reach 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), compare it to similar tools like 'ssh_connect' (which might list active connections), or specify use cases (e.g., credential management vs. connection establishment).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.