Skip to main content
Glama
soriat

MCP Elicitations Demo Server

by soriat

printEnv

Displays all environment variables for debugging server configurations on the MCP Elicitations Demo Server, aiding in dynamic user input setups.

Instructions

Prints all environment variables, helpful for debugging MCP server configuration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The async handler function for the printEnv tool, which returns all environment variables as a formatted JSON string in a text content block.
    handler: async (args: any) => {
      return {
        content: [
          {
            type: "text" as const,
            text: JSON.stringify(process.env, null, 2),
          },
        ],
      };
    },
  • Zod schema definition for the printEnv tool input, which accepts no parameters (empty object).
    const PrintEnvSchema = z.object({});
  • The allTools array that aggregates all tool objects, including printEnvTool, for use in tool listing and handler lookup.
    const allTools = [
      echoTool,
      addTool,
      longRunningOperationTool,
      printEnvTool,
      sampleLlmTool,
      sampleWithPreferencesTool,
      sampleMultimodalTool,
      sampleConversationTool,
      sampleAdvancedTool,
      getTinyImageTool,
      annotatedMessageTool,
      getResourceReferenceTool,
      elicitationTool,
      getResourceLinksTool,
    ];
  • Registers the MCP protocol request handlers for listing tools and calling tools on the server, enabling execution of printEnv via getToolHandler.
    export const setupTools = (server: Server) => {
      // Handle listing all available tools
      server.setRequestHandler(ListToolsRequestSchema, async () => {
        return { tools: getTools() };
      });
    
      // Handle tool execution
      server.setRequestHandler(CallToolRequestSchema, async (request) => {
        const { name, arguments: args } = request.params;
        const handler = getToolHandler(name);
    
        if (handler) {
          return await handler(args, request, server);
        }
    
        throw new Error(`Unknown tool: ${name}`);
      });
    };
  • Calls setupTools on the main server instance, finalizing the registration of all tools including printEnv.
    setupTools(server);
Behavior3/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. It discloses the tool's behavior (prints all environment variables) and its purpose (debugging), but lacks details like output format, security implications (e.g., exposing sensitive data), or performance characteristics. This is adequate but has 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 that front-loads the core action ('Prints all environment variables') and adds value with the debugging context. Every word earns its place with no waste.

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 simplicity (0 parameters, no output schema, no annotations), the description is complete enough for basic use. However, it lacks details on output format (e.g., structured vs. plain text) and potential risks (e.g., exposing secrets), which could be important for debugging scenarios.

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 appropriately does not discuss parameters, earning a high baseline score for not adding unnecessary information.

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 specific action ('Prints') and resource ('all environment variables'), and distinguishes its debugging purpose from sibling tools like 'echo' or 'getResourceLinks' which serve different functions. It goes beyond a tautology by explaining what gets printed.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to use this tool ('helpful for debugging MCP server configuration'), providing clear context. However, it does not specify when not to use it or name alternatives among siblings, which prevents a perfect score.

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

Related 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/soriat/soria-mcp'

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