Skip to content

Commit

Permalink
Added printenv to the everything server to help debug environment var…
Browse files Browse the repository at this point in the history
…iable configuration
  • Loading branch information
jerome3o-anthropic committed Dec 18, 2024
1 parent 3ff22e8 commit e198e36
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/everything/everything.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ const LongRunningOperationSchema = z.object({
steps: z.number().default(5).describe("Number of steps in the operation"),
});

const PrintEnvSchema = z.object({});

const SampleLLMSchema = z.object({
prompt: z.string().describe("The prompt to send to the LLM"),
maxTokens: z
Expand All @@ -54,6 +56,7 @@ enum ToolName {
ECHO = "echo",
ADD = "add",
LONG_RUNNING_OPERATION = "longRunningOperation",
PRINT_ENV = "printEnv",
SAMPLE_LLM = "sampleLLM",
GET_TINY_IMAGE = "getTinyImage",
}
Expand Down Expand Up @@ -297,6 +300,11 @@ export const createServer = () => {
description: "Adds two numbers",
inputSchema: zodToJsonSchema(AddSchema) as ToolInput,
},
{
name: ToolName.PRINT_ENV,
description: "Prints all environment variables, helpful for debugging MCP server configuration",
inputSchema: zodToJsonSchema(PrintEnvSchema) as ToolInput,
},
{
name: ToolName.LONG_RUNNING_OPERATION,
description:
Expand Down Expand Up @@ -374,6 +382,17 @@ export const createServer = () => {
};
}

if (name === ToolName.PRINT_ENV) {
return {
content: [
{
type: "text",
text: JSON.stringify(process.env, null, 2),
},
],
};
}

if (name === ToolName.SAMPLE_LLM) {
const validatedArgs = SampleLLMSchema.parse(args);
const { prompt, maxTokens } = validatedArgs;
Expand Down

0 comments on commit e198e36

Please sign in to comment.