Skip to main content
Glama
hidenorigoto

Sakura Cloud MCP Server

by hidenorigoto

update_apprun

Modify an existing AppRun application's configuration, including its name, Docker image, plan, environment variables, and description.

Instructions

Update an existing AppRun application

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appIdYesThe ID of the AppRun application to update
nameNoNew name of the AppRun application
descriptionNoNew description of the AppRun application
dockerImageNoNew Docker image to use for the AppRun application
planIdNoNew plan ID for the AppRun application
environmentNoNew environment variables for the AppRun application
zoneNoThe zone to use (e.g., "tk1v", "is1a", "tk1a"). Defaults to "tk1v" if not specified.

Implementation Reference

  • Handler function that executes the 'update_apprun' tool: fetches current app data, merges with provided updates (name, description, dockerImage, planId, environment), sends PUT request to AppRun API, returns result.
    } else if (request.params.name === 'update_apprun') {
      try {
        validateCredentials();
        
        const appId = request.params.arguments?.appId as string;
        if (!appId) {
          throw new Error('AppRun application ID is required');
        }
        
        // Get current application data first
        const currentApp = await fetchFromAppRunAPI(`/applications/${appId}`);
        
        // Extract current values
        const currentName = currentApp.name || '';
        const currentDescription = currentApp.description || '';
        const currentPlanId = currentApp.planId || '';
        const currentDockerImage = currentApp.image || '';
        const currentEnvironment = currentApp.environment || [];
        
        // Get update values from request or use current values
        const name = request.params.arguments?.name as string || currentName;
        const description = request.params.arguments?.description as string || currentDescription;
        const planId = request.params.arguments?.planId as string || currentPlanId;
        const dockerImage = request.params.arguments?.dockerImage as string || currentDockerImage;
        const environment = request.params.arguments?.environment as Array<{key: string, value: string}> || 
          currentEnvironment.map((env: {Key: string, Value: string}) => ({ key: env.Key, value: env.Value }));
        
        const zone = request.params.arguments?.zone as string || DEFAULT_ZONE;
        
        const updateBody = {
          name: name,
          description: description,
          planId: planId,
          image: dockerImage,
          environment: environment.map(env => ({ key: env.key, value: env.value })),
        };
        
        const updateResult = await fetchFromAppRunAPI(`/applications/${appId}`, 'PUT', updateBody);
        
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(updateResult, null, 2)
            }
          ]
        };
      } catch (error) {
        console.error('Error calling tool:', error);
        throw error;
      }
  • Registration of 'update_apprun' tool in ListToolsRequestSchema handler, including input schema definition.
    name: 'update_apprun',
    description: 'Update an existing AppRun application',
    inputSchema: {
      type: 'object',
      properties: {
        appId: {
          type: 'string',
          description: 'The ID of the AppRun application to update'
        },
        name: {
          type: 'string',
          description: 'New name of the AppRun application'
        },
        description: {
          type: 'string',
          description: 'New description of the AppRun application'
        },
        dockerImage: {
          type: 'string',
          description: 'New Docker image to use for the AppRun application'
        },
        planId: {
          type: 'string',
          description: 'New plan ID for the AppRun application'
        },
        environment: {
          type: 'array',
          description: 'New environment variables for the AppRun application',
          items: {
            type: 'object',
            properties: {
              key: { type: 'string' },
              value: { type: 'string' }
            }
          }
        },
        zone: {
          type: 'string',
          description: 'The zone to use (e.g., "tk1v", "is1a", "tk1a"). Defaults to "tk1v" if not specified.'
        }
      },
      required: ['appId']
    }
  • Helper function used by update_apprun (and other AppRun tools) to make authenticated HTTPS requests to Sakura Cloud AppRun API.
    async function fetchFromAppRunAPI(path: string, method: string = 'GET', bodyData?: any): Promise<any> {
      return new Promise((resolve, reject) => {
        validateCredentials();
        
        const options = {
          hostname: 'secure.sakura.ad.jp',
          port: 443,
          path: `/cloud/api/apprun/1.0/apprun/api${path}`,
          method: method,
          headers: {
            'Accept': 'application/json',
            'Content-Type': 'application/json',
            'Authorization': `Basic ${Buffer.from(`${SACLOUD_API_TOKEN}:${SACLOUD_API_SECRET}`).toString('base64')}`
          }
        };
    
        const req = https.request(options, (res) => {
          let data = '';
          
          res.on('data', (chunk) => {
            data += chunk;
          });
          
          res.on('end', () => {
            try {
              if (data) {
                const parsedData = JSON.parse(data);
                resolve(parsedData);
              } else {
                resolve({});
              }
            } catch (err) {
              reject(new Error(`Failed to parse response: ${err}`));
            }
          });
        });
        
        req.on('error', (error) => {
          reject(error);
        });
        
        if (bodyData && (method === 'POST' || method === 'PUT')) {
          req.write(JSON.stringify(bodyData));
        }
        
        req.end();
      });
    }
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 but offers minimal information. It states this is an update operation (implying mutation) but doesn't cover permissions needed, whether changes are reversible, side effects (e.g., downtime), rate limits, or what the response contains. This is inadequate for a mutation 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 that states the core purpose without unnecessary words. It's appropriately sized and front-loaded with the essential information, though it could benefit from additional context in subsequent sentences.

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?

For a mutation tool with 7 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what happens during an update (e.g., whether the app restarts), error handling, or typical use cases. Given the complexity and lack of structured data, more descriptive content is needed to guide the agent effectively.

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 fully documents all 7 parameters. The description adds no parameter-specific information beyond what's in the schema (e.g., it doesn't explain relationships between parameters or provide examples). This meets the baseline for high schema coverage but doesn't enhance understanding.

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 ('Update') and resource ('existing AppRun application'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its sibling 'create_apprun' beyond the obvious 'existing' vs 'new' distinction, nor does it specify what aspects can be updated versus what requires other tools.

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 like 'create_apprun' or 'delete_apprun'. It doesn't mention prerequisites (e.g., needing an existing appId), error conditions, or typical workflows. The agent must infer usage from 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/hidenorigoto/sacloud-mcp'

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