get_server_resources
Retrieve server resource usage data from Coolify self-hosted PaaS instances to monitor performance and manage deployments effectively.
Instructions
Get server resource usage
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uuid | Yes | Server UUID |
Implementation Reference
- src/tools/handlers.ts:83-85 (handler)Implements the core logic for the get_server_resources tool: validates the server UUID input and fetches resource usage data from the Coolify API endpoint `/servers/{uuid}/resources`.case 'get_server_resources': requireParam(args, 'uuid'); return client.get(`/servers/${args.uuid}/resources`);
- src/tools/definitions.ts:184-191 (schema)Defines the tool schema, including name, description, and input schema that requires a 'uuid' parameter of type string for the server UUID.{ name: 'get_server_resources', description: 'Get server resource usage', inputSchema: { type: 'object', properties: { uuid: { type: 'string', description: 'Server UUID' } }, required: ['uuid'] }
- src/index.ts:36-38 (registration)Registers the MCP listTools request handler, which returns all tool definitions (including get_server_resources) from getToolDefinitions().this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: getToolDefinitions() }));
- src/index.ts:41-67 (registration)Registers the MCP callTool request handler, which dispatches tool execution to handleTool based on the tool name (including get_server_resources).this.server.setRequestHandler(CallToolRequestSchema, async (request) => { if (!this.client) { throw new McpError(ErrorCode.InternalError, 'Client not initialized'); } const { name, arguments: args } = request.params; // Block write operations in read-only mode if (isReadOnlyMode() && !READ_ONLY_TOOLS.includes(name)) { throw new McpError( ErrorCode.InvalidRequest, `Operation '${name}' is not allowed in read-only mode. Set COOLIFY_READONLY=false to enable write operations.` ); } try { const result = await handleTool(this.client, name, args || {}); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error) { if (error instanceof McpError) throw error; const message = error instanceof Error ? error.message : 'Unknown error'; throw new McpError(ErrorCode.InternalError, `Tool execution failed: ${message}`); } });
- src/tools/definitions.ts:14-14 (helper)Includes get_server_resources in the READ_ONLY_TOOLS array, making it available even in read-only mode.'get_server_resources',