Skip to main content
Glama

create-app

Deploy applications on Koyeb by specifying a name to automate cloud infrastructure setup and management.

Instructions

Create an app

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYes

Implementation Reference

  • The createApiTool function creates the actual handler for the create-app tool. It takes 'createApp' as the name parameter, retrieves the corresponding function from the @koyeb/api-client-js package, and returns an async callback that invokes the API with authentication and parameters, returning the result as text content.
    export function createApiTool(name: keyof Koyeb): ToolCallback<ZodRawShape> {
      const fn = koyeb[name] as Function;
    
      return async (params: object) => {
        const result = await fn({ auth, ...params });
    
        if (result.error) {
          return createTextContent('Error: ' + result.error ? JSON.stringify(result.error) : 'unknown error');
        }
    
        return createTextContent(JSON.stringify(result.data));
      };
    }
  • The schema for create-app is defined inline using Zod. It expects a body object with a required 'name' string field that describes the app name.
    server.tool(
      'create-app',
      'Create an app',
      {
        body: z.object({
          name: z.string().describe('The name of the app'),
        }),
      },
      createApiTool('createApp'),
    );
  • src/tools/app.ts:6-41 (registration)
    The app() function exports and registers all app-related tools including 'create-app' on the MCP server. This function is called from src/index.ts to initialize the tools.
    export function app(server: McpServer) {
      server.tool(
        'list-apps',
        'List apps',
        {
          query: z.object({
            limit: z.string().optional().describe('The number of items to return'),
            name: z.string().optional().describe('A filter for name'),
            offset: z.string().optional().describe('The offset in the list of item to return'),
          }),
        },
        createApiTool('listApps'),
      );
    
      server.tool(
        'get-app',
        'Get an app by its id',
        {
          path: z.object({
            id: z.string().describe('The id of the App'),
          }),
        },
        createApiTool('getApp'),
      );
    
      server.tool(
        'create-app',
        'Create an app',
        {
          body: z.object({
            name: z.string().describe('The name of the app'),
          }),
        },
        createApiTool('createApp'),
      );
    }
  • src/index.ts:28-28 (registration)
    The main entry point calls app(server) to register the create-app tool along with other app-related tools on the MCP server instance.
    app(server);

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

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