Skip to main content
Glama
JackXuyi

Current operating environment

getSshPublicKey

Retrieve the SSH public key for the current user to configure secure remote access and authentication.

Instructions

获取当前用户的 SSH 公钥

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler implementation for the getSshPublicKey tool. It lists all .pub files in the user's ~/.ssh directory, reads their contents, and returns the public keys as a JSON array.
    case "getSshPublicKey": {
      const sshKeys: string[] = [];
      const sshDir = `${os.homedir()}/.ssh`;
    
      const keyFiles = fs.readdirSync(sshDir).filter(file => file.endsWith('.pub'));
      for (const keyFile of keyFiles) {
        const filePath = `${sshDir}/${keyFile}`;
        const publicKey = fs.readFileSync(filePath, 'utf8');
        sshKeys.push(publicKey);
      }
    
      return {
        content: [{
          type: "text",
          text: JSON.stringify(sshKeys, null, 2)
        }]
      };
    }
  • src/index.ts:253-261 (registration)
    Registration of the getSshPublicKey tool in the list of available tools, including its name, description, and empty input schema.
    {
      name: "getSshPublicKey",
      description: "获取当前用户的 SSH 公钥",
      inputSchema: {
        type: "object",
        properties: {},
        required: []
      }
    },
  • Input schema for the getSshPublicKey tool, which expects no parameters (empty object).
    inputSchema: {
      type: "object",
      properties: {},
      required: []
    }
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 only states what the tool does ('get'), without mentioning whether it's read-only, requires authentication, has rate limits, returns specific formats, or handles errors. This is inadequate for a tool with zero annotation coverage.

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 in Chinese that directly states the purpose without any fluff or redundancy. It's appropriately sized and front-loaded, making it easy for an agent 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 lack of annotations and output schema, the description is incomplete. It doesn't explain what the SSH public key output looks like (e.g., format, key type), potential errors, or behavioral traits. For a tool that retrieves security-sensitive information, this leaves significant gaps for an agent.

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 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description doesn't add parameter details, but that's appropriate here. A baseline of 4 is given as it meets expectations for a parameterless tool.

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 ('获取' meaning 'get') and resource ('当前用户的 SSH 公钥' meaning 'current user's SSH public key'), providing a specific purpose. However, it doesn't explicitly differentiate from sibling tools like 'getUserInfo' which might also provide user-related information, preventing 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. With many sibling tools (e.g., 'getUserInfo', 'getPlatformInfo'), there's no indication of context, prerequisites, or exclusions, leaving the agent to guess based on the tool name alone.

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/JackXuyi/env-mcp'

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