Skip to main content
Glama

update-application

Modify application settings including health checks, domains, and monitoring configurations to adjust behavior and performance.

Instructions

Update the settings of a specific application, such as health check configurations. This allows you to modify the application's behavior and monitoring settings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uuidYesResource UUID
settingsYes

Implementation Reference

  • Handler for the 'update-application' tool. Parses UUID and settings from arguments, makes a PATCH request to the Coolify API endpoint `/applications/{uuid}` with the settings, and returns the JSON response.
    case "update-application": {
      const { uuid, settings } = request.params.arguments as { uuid: string; settings: any };
      const result = await coolifyApiCall(`/applications/${uuid}`, 'PATCH', settings);
      return {
        content: [{
          type: "text",
          text: JSON.stringify(result, null, 2)
        }]
      };
    }
  • Zod schema defining the updateable settings for an application, including various health check configurations and basic metadata like name, description, and domains.
    const ApplicationUpdateSchema = z.object({
      health_check_enabled: z.boolean().optional(),
      health_check_path: z.string().optional(),
      health_check_port: z.string().nullable().optional(),
      health_check_host: z.string().nullable().optional(),
      health_check_method: z.string().optional(),
      health_check_return_code: z.number().optional(),
      health_check_scheme: z.string().optional(),
      health_check_response_text: z.string().nullable().optional(),
      health_check_interval: z.number().optional(),
      health_check_timeout: z.number().optional(),
      health_check_retries: z.number().optional(),
      health_check_start_period: z.number().optional(),
      // Add other updateable fields
      name: z.string().optional(),
      description: z.string().optional(),
      domains: z.string().optional(),
    });
  • src/index.ts:133-140 (registration)
    Registration of the 'update-application' tool in the ListTools response, specifying name, description, and input schema (uuid + settings).
    {
      name: "update-application",
      description: "Update the settings of a specific application, such as health check configurations. This allows you to modify the application's behavior and monitoring settings.",
      inputSchema: zodToJsonSchema(z.object({
        uuid: z.string().describe("Resource UUID"),
        settings: ApplicationUpdateSchema
      })),
    },
  • Helper function used by the handler to make authenticated API calls to the Coolify server, handling GET/PATCH/etc. with error management.
    async function coolifyApiCall(endpoint: string, method: string = 'GET', body?: any): Promise<any> {
      const baseUrl = process.env.COOLIFY_BASE_URL?.replace(/\/$/, '') || 'https://coolify.stuartmason.co.uk';
      const url = `${baseUrl}/api/v1${endpoint}`;
    
      const response = await fetch(url, {
        method,
        headers: {
          'Authorization': `Bearer ${process.env.COOLIFY_ACCESS_TOKEN}`,
          'Content-Type': 'application/json',
        },
        body: body ? JSON.stringify(body) : undefined,
      });
    
      if (!response.ok) {
        const errorBody = await response.json().catch(() => ({}));
        throw new Error(JSON.stringify({
          error: `Coolify API error: ${response.status} ${response.statusText}`,
          status: response.status,
          details: errorBody
        }));
      }
    
      return await response.json();
    }

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

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