Skip to main content
Glama

ssh_delete_credential

Remove a saved SSH credential from the MCP SSH Server to manage authentication profiles and maintain security by deleting unused or outdated access credentials.

Instructions

Delete a saved SSH credential

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
credentialIdYesCredential ID to delete

Implementation Reference

  • Handler function that parses input using DeleteCredentialSchema, checks if credential exists in the store, deletes it from the Map, and returns success message with details.
    private async handleDeleteCredential(args: unknown) {
      const params = DeleteCredentialSchema.parse(args);
      
      if (!credentialStore.has(params.credentialId)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          `Credential ID '${params.credentialId}' not found`
        );
      }
    
      const credential = credentialStore.get(params.credentialId)!;
      credentialStore.delete(params.credentialId);
    
      return {
        content: [
          {
            type: 'text',
            text: `Credential '${params.credentialId}' (${credential.username}@${credential.host}) deleted successfully`,
          },
        ],
      };
    }
  • Zod schema for validating input parameters: requires 'credentialId' string.
    const DeleteCredentialSchema = z.object({
      credentialId: z.string().describe('Credential ID to delete')
    });
  • src/index.ts:397-407 (registration)
    Tool registration in ListTools response: defines name, description, and inputSchema matching the DeleteCredentialSchema.
    {
      name: 'ssh_delete_credential',
      description: 'Delete a saved SSH credential',
      inputSchema: {
        type: 'object',
        properties: {
          credentialId: { type: 'string', description: 'Credential ID to delete' }
        },
        required: ['credentialId']
      },
    },
  • src/index.ts:509-510 (registration)
    Switch case in CallToolRequest handler that routes to the handleDeleteCredential function.
    case 'ssh_delete_credential':
      return await this.handleDeleteCredential(args);
  • In-memory Map storing SSH credentials by ID, used by the delete handler.
    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 full burden for behavioral disclosure. It states the destructive action ('Delete') but doesn't cover critical aspects: whether deletion is permanent or reversible, if it affects active SSH sessions using the credential, required permissions, error conditions (e.g., invalid ID), or side effects. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding behavior.

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 with zero waste—'Delete a saved SSH credential' directly conveys the core action and resource. It's front-loaded and appropriately sized for a simple tool, with no extraneous details. Every word earns its place, making it easy to parse quickly.

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 (a destructive operation with no annotations and no output schema), the description is incomplete. It lacks information on behavioral traits (e.g., permanence, dependencies), error handling, or output expectations. While the schema covers the parameter, the description doesn't compensate for missing context about the mutation's impact, making it inadequate for safe and effective use.

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 description coverage is 100%, with the single parameter 'credentialId' fully documented in the schema as 'Credential ID to delete'. The description adds no additional meaning about the parameter beyond what the schema provides—it doesn't explain ID format, source (e.g., from 'ssh_list_credentials'), or validation rules. Baseline 3 is appropriate since the schema does the heavy lifting.

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 action ('Delete') and resource ('a saved SSH credential'), making the purpose immediately understandable. It distinguishes from siblings like 'ssh_list_credentials' and 'ssh_save_credential' by specifying deletion rather than listing or creation. However, it doesn't specify what constitutes a 'saved SSH credential' beyond the ID parameter, leaving some ambiguity about the resource scope.

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 an existing credential from 'ssh_list_credentials'), exclusions (e.g., not for active connections), or related tools like 'ssh_connect_with_credential' that might depend on saved credentials. Usage is implied only by the action name, with no explicit context for 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/mahathirmuh/mcp-ssh-server'

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