Skip to main content
Glama
hidenorigoto

Sakura Cloud MCP Server

by hidenorigoto

create_apprun

Create a new AppRun application on Sakura Cloud by specifying name, Docker image, plan, and optional environment variables and zone.

Instructions

Create a new AppRun application

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the AppRun application
descriptionNoDescription of the AppRun application
dockerImageYesDocker image to use for the AppRun application
planIdYesPlan ID for the AppRun application
environmentNoEnvironment variables for the AppRun application
zoneNoThe zone to use (e.g., "tk1v", "is1a", "tk1a"). Defaults to "tk1v" if not specified.

Implementation Reference

  • Input schema definition for the create_apprun tool, defining parameters like name, dockerImage, planId, etc.
    name: 'create_apprun',
    description: 'Create a new AppRun application',
    inputSchema: {
      type: 'object',
      properties: {
        name: {
          type: 'string',
          description: 'Name of the AppRun application'
        },
        description: {
          type: 'string',
          description: 'Description of the AppRun application'
        },
        dockerImage: {
          type: 'string',
          description: 'Docker image to use for the AppRun application'
        },
        planId: {
          type: 'string',
          description: 'Plan ID for the AppRun application'
        },
        environment: {
          type: 'array',
          description: '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: ['name', 'dockerImage', 'planId']
    }
  • The handler function that implements create_apprun by validating inputs, preparing the request body, and calling the Sakura Cloud AppRun API to create the application.
    } else if (request.params.name === 'create_apprun') {
      try {
        validateCredentials();
        
        const name = request.params.arguments?.name as string;
        const description = request.params.arguments?.description as string || '';
        const dockerImage = request.params.arguments?.dockerImage as string;
        const planId = request.params.arguments?.planId as string;
        const environment = request.params.arguments?.environment as Array<{key: string, value: string}> || [];
        
        if (!name || !dockerImage || !planId) {
          throw new Error('Name, Docker image, and plan ID are required');
        }
        
        const zone = request.params.arguments?.zone as string || DEFAULT_ZONE;
        
        const createBody = {
          name: name,
          description: description,
          planId: planId,
          image: dockerImage,
          environment: environment.map(env => ({ key: env.key, value: env.value })),
        };
        
        const createResult = await fetchFromAppRunAPI('/applications', 'POST', createBody);
        
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(createResult, null, 2)
            }
          ]
        };
      } catch (error) {
        console.error('Error calling tool:', error);
        throw error;
      }
  • Helper function used by create_apprun (and other AppRun tools) to make authenticated HTTPS requests to the 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();
      });
    }
  • The tool is registered by being included in the list returned by ListToolsRequestSchema handler.
      name: 'create_apprun',
      description: 'Create a new AppRun application',
      inputSchema: {
        type: 'object',
        properties: {
          name: {
            type: 'string',
            description: 'Name of the AppRun application'
          },
          description: {
            type: 'string',
            description: 'Description of the AppRun application'
          },
          dockerImage: {
            type: 'string',
            description: 'Docker image to use for the AppRun application'
          },
          planId: {
            type: 'string',
            description: 'Plan ID for the AppRun application'
          },
          environment: {
            type: 'array',
            description: '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: ['name', 'dockerImage', 'planId']
      }
    },
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 'Create' which implies a write/mutation operation, but doesn't mention permissions required, whether this is idempotent, what happens on failure, or typical response format. For a creation tool with zero annotation coverage, this leaves significant behavioral 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, clear sentence that states exactly what the tool does with zero wasted words. It's appropriately sized and front-loaded with the essential information.

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 creation tool with 6 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what happens after creation, how to verify success, error conditions, or relationship to other tools like 'get_apprun_info'. The agent lacks crucial context for proper tool invocation.

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?

The schema description coverage is 100%, so all parameters are documented in the schema itself. The description adds no additional parameter information beyond what's already in the schema descriptions. This meets the baseline expectation when schema coverage is complete.

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 ('Create') and resource ('new AppRun application'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its sibling 'update_apprun' or explain what distinguishes creation from updating, which prevents a perfect score.

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 'update_apprun' or what prerequisites might be needed. It doesn't mention any context for creation (e.g., after planning or as an initial setup), leaving the agent without usage direction.

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