Skip to main content
Glama
pulumi

@pulumi/mcp-server

Official
by pulumi

pulumi-cli-up

Execute pulumi up for a specific project and stack to deploy infrastructure updates. Define the working directory and stack name for targeted deployment.

Instructions

Run pulumi up for a given project and stack

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stackNameNoThe associated stack name. Defaults to 'dev'.
workDirYesThe working directory of the program.

Implementation Reference

  • Executes the pulumi up command using Pulumi's automation API: creates or selects a stack, runs stack.up(), summarizes resource changes, and returns formatted results.
        handler: async (args: UpArgs) => {
          const stackArgs: automation.LocalProgramArgs = {
            stackName: args.stackName ?? 'dev',
            workDir: args.workDir
          };
    
          const stack = await automation.LocalWorkspace.createOrSelectStack(stackArgs);
    
          // Run up
          const upResult = await stack.up();
    
          // Format the changes
          const changes = upResult.summary.resourceChanges!;
          const changesSummary = [
            `Create: ${changes.create}`,
            `Update: ${changes.update}`,
            `Delete: ${changes.delete}`,
            `Same: ${changes.same}`
          ].join('\n');
    
          return {
            description: 'Pulumi Up Results',
            content: [
              {
                type: 'text' as const,
                text: `
    Deployment Results for stack: ${stack.name}
    
    Changes:
    ${changesSummary}
    
    ${upResult.stdout || 'No additional output'}
    `
              }
            ]
          };
        }
  • Zod schema defining inputs for the tool: workDir (required string), stackName (optional string, defaults to 'dev').
    schema: {
      workDir: z.string().describe('The working directory of the program.'),
      stackName: z.string().optional().describe("The associated stack name. Defaults to 'dev'.")
    },
  • Registers the 'pulumi-cli-up' tool (and other CLI commands) by iterating over exported cliCommands from src/pulumi/cli.ts, constructing toolName as 'pulumi-cli-${commandName}' where commandName='up', and wrapping the handler with error handling.
      const toolName = `pulumi-cli-${commandName}`;
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      this.tool(toolName, command.description, command.schema, async (args: any) => {
        try {
          return await command.handler(args);
        } catch (error) {
          return handleError(error, toolName);
        }
      });
    });
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 action ('Run pulumi up') which implies a write/mutation operation that applies infrastructure changes, but fails to mention critical traits like potential destructive effects, authentication requirements, execution time, or error handling. This leaves significant gaps in understanding the tool's 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 that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, with every part contributing essential information about the action and target.

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 complexity of a CLI tool that likely performs infrastructure deployments (a mutation operation), no annotations, no output schema, and 2 parameters, the description is incomplete. It doesn't cover what the tool returns, error conditions, side effects, or how it interacts with the Pulumi ecosystem, 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%, so the schema already documents both parameters ('stackName' and 'workDir') with descriptions. The tool description adds no additional meaning about parameters beyond what's in the schema, such as explaining how 'workDir' relates to the Pulumi project or default behaviors. Baseline 3 is appropriate when 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 ('Run pulumi up') and specifies the target ('for a given project and stack'), which is a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'pulumi-cli-preview' (which likely shows changes without applying them), leaving room for improvement in sibling distinction.

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 a Pulumi project setup), contrast with 'pulumi-cli-preview' for dry runs, or specify scenarios like deploying infrastructure changes. This lack of context makes it harder for an agent to choose appropriately among siblings.

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/pulumi/mcp-server'

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