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

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