diff --git a/.github/workflows/token-budget.yml b/.github/workflows/token-budget.yml new file mode 100644 index 0000000..66675e1 --- /dev/null +++ b/.github/workflows/token-budget.yml @@ -0,0 +1,16 @@ +name: token-budget +on: + pull_request: + paths: + - 'server.go' + - 'codemode/tools.go' + - 'scripts/count-tokens.ts' + - '.github/workflows/token-budget.yml' +jobs: + budget: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v1 + - run: bun install --frozen-lockfile + - run: bun scripts/count-tokens.ts diff --git a/Dockerfile b/Dockerfile index 856b096..f14fb37 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,12 @@ -# syntax=docker/dockerfile:1 -FROM debian:stable-slim -COPY --link --from=gcr.io/distroless/base /etc/ssl/certs/ /etc/ssl/certs/ -RUN --mount=type=cache,target=/var/cache/apt \ - --mount=type=cache,target=/var/lib/apt/lists \ - apt-get update && apt-get install -y --no-install-recommends openssl curl -WORKDIR /app -COPY --link ./nodeops ./ -ENTRYPOINT [ "/bin/sh", "-c" ] +FROM golang:1.26-alpine AS build +WORKDIR /src +COPY go.mod go.sum ./ +RUN go mod download +COPY . . +RUN CGO_ENABLED=0 GOOS=linux go build -o /out/createos-mcp . + +FROM gcr.io/distroless/static:nonroot +COPY --from=build /out/createos-mcp /createos-mcp +EXPOSE 8080 9090 +USER nonroot:nonroot +ENTRYPOINT ["/createos-mcp"] diff --git a/README.md b/README.md index dbdb792..1085668 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ The [Model Context Protocol (MCP)](https://modelcontextprotocol.io) is an open standard originated by Anthropic that enables AI assistants โ€” Claude, Cursor, GitHub Copilot, Windsurf, Gemini, and others โ€” to securely connect to external tools, APIs, and services through a unified interface. The latest MCP Authorization and Streamable HTTP specifications are fully implemented. -**CreateOS MCP** is a production-grade MCP server that exposes **85+ tools** for full-stack application deployment and infrastructure management on the [CreateOS](https://createos.nodeops.network) platform. Connect it once to your AI coding tool, then deploy projects, manage environments, configure domains, run security scans, analyze deployment metrics, and more โ€” all through natural language. +**CreateOS MCP** is a production-grade MCP server that exposes **10 tools** (7 native + 3 code-mode) for full-stack application deployment and infrastructure management on the [CreateOS](https://createos.nodeops.network) platform. Connect it once to your AI coding tool, then deploy projects, manage environments, configure domains, run security scans, analyze deployment metrics, and more โ€” all through natural language. The full ~100-endpoint CreateOS API is reachable via the `search`/`execute`/`pollJob` Code Mode tools backed by a `workerd` V8 sandbox. Instead of switching between dashboards, CLIs, and documentation, you stay in your editor and let your AI handle the infrastructure. CreateOS MCP turns prompts like *"deploy my app from this GitHub repo"* or *"scale the staging environment to 3 replicas"* into real actions, executed instantly. @@ -25,7 +25,7 @@ Built in Go for performance and reliability, the server supports both **Streamab ## Features -- ๐Ÿš€ **85+ MCP Tools** โ€” Full coverage of the CreateOS platform API: projects, deployments, environments, domains, templates, and more +- ๐Ÿš€ **10 MCP Tools** โ€” 7 native fast-path tools plus 3 code-mode tools (search/execute/pollJob) that reach the full ~100-endpoint CreateOS platform API - ๐Ÿ”Œ **9 Supported Clients** โ€” Cursor, VS Code + Copilot, Claude Desktop, Claude Code, Windsurf, Gemini CLI, Gemini Code Assist, Opencode, Zapier, and ElevenLabs - ๐Ÿ” **Secure Authentication** โ€” API key and OAuth 2.0 with Dynamic Client Registration (RFC 7591), Protected Resource Metadata (RFC 9728) - โšก **Dual Transport** โ€” Streamable HTTP for remote access, stdio for local/embedded use @@ -200,9 +200,41 @@ npx @modelcontextprotocol/inspector --- +## Code Mode (v2) + +CreateOS MCP v2 exposes only 10 tools. The CreateOS API surface (~100 endpoints) is reachable via three code-mode tools: + +- `search(code)` โ€” read the OpenAPI spec from a sandboxed JS arrow fn. No network. +- `execute(code)` โ€” run JS that calls `api..(args)` (or `api.raw(method, path, opts)`) against the API. Chained operations run in one sandbox call. +- `pollJob(jobId)` โ€” when an `execute` exceeds 90s it returns `{status: "running", jobId}`. Loop `pollJob` until `status != "running"`. + +The sandbox is a `workerd` sidecar running each call in a fresh V8 isolate (Dynamic Worker Loader). No filesystem, no env vars, no ambient `fetch` โ€” only the pre-installed `api` proxy, `console`, and `sleep` are available. + +### Native fast-path tools (always available) + +`GetQuotas`, `GetSupportedProjectTypes`, `CheckProjectUniqueName`, `CreateProject`, `UploadDeploymentBase64Files`, `GetDeployment`, `CancelDeployment`. + +### Example + +```js +// execute(code) +async () => { + const { data: dep } = await api.deployments.create({ projectId: "...", source: "upload" }); + for (let i = 0; i < 20; i++) { + await sleep(30000); + const s = await api.deployments.get({ id: dep.id }); + if (s.data.status === "deployed") return s.data.url; + if (s.data.status === "failed") throw new Error(s.data.error); + } + throw new Error("timeout"); +} +``` + +If the deploy takes > 90s, the call returns `{status:"running", jobId}`; loop `pollJob(jobId)` until done. + ## Supported Tools -The server exposes **85+ tools** organized into the following categories: +The server exposes **10 tools** organized into the following categories: | Category | Tools | Description | |----------|-------|-------------| diff --git a/bun.lock b/bun.lock new file mode 100644 index 0000000..a0a336f --- /dev/null +++ b/bun.lock @@ -0,0 +1,24 @@ +{ + "lockfileVersion": 1, + "configVersion": 1, + "workspaces": { + "": { + "name": "createos-mcp-tooling", + "devDependencies": { + "@types/bun": "latest", + "tiktoken": "^1.0.17", + }, + }, + }, + "packages": { + "@types/bun": ["@types/bun@1.3.13", "", { "dependencies": { "bun-types": "1.3.13" } }, "sha512-9fqXWk5YIHGGnUau9TEi+qdlTYDAnOj+xLCmSTwXfAIqXr2x4tytJb43E9uCvt09zJURKXwAtkoH4nLQfzeTXw=="], + + "@types/node": ["@types/node@25.6.0", "", { "dependencies": { "undici-types": "~7.19.0" } }, "sha512-+qIYRKdNYJwY3vRCZMdJbPLJAtGjQBudzZzdzwQYkEPQd+PJGixUL5QfvCLDaULoLv+RhT3LDkwEfKaAkgSmNQ=="], + + "bun-types": ["bun-types@1.3.13", "", { "dependencies": { "@types/node": "*" } }, "sha512-QXKeHLlOLqQX9LgYaHJfzdBaV21T63HhFJnvuRCcjZiaUDpbs5ED1MgxbMra71CsryN/1dAoXuJJJwIv/2drVA=="], + + "tiktoken": ["tiktoken@1.0.22", "", {}, "sha512-PKvy1rVF1RibfF3JlXBSP0Jrcw2uq3yXdgcEXtKTYn3QJ/cBRBHDnrJ5jHky+MENZ6DIPwNUGWpkVx+7joCpNA=="], + + "undici-types": ["undici-types@7.19.2", "", {}, "sha512-qYVnV5OEm2AW8cJMCpdV20CDyaN3g0AjDlOGf1OW4iaDEx8MwdtChUp4zu4H0VP3nDRF/8RKWH+IPp9uW0YGZg=="], + } +} diff --git a/codemode/auth.go b/codemode/auth.go new file mode 100644 index 0000000..6a80ffe --- /dev/null +++ b/codemode/auth.go @@ -0,0 +1,89 @@ +package codemode + +import ( + "context" + "os" + "strings" + + "github.com/mark3labs/mcp-go/mcp" +) + +// Auth flows: +// - HTTP transport: mcp-go attaches request headers to mcp.CallToolRequest. +// AuthFromRequest reads them directly. HTTP middleware also mirrors them +// into ctx via WithAuthHeaders as a backup path. +// - stdio transport: there is no per-request HTTP header. Auth comes from +// environment variables: CREATEOS_API_KEY and/or CREATEOS_BEARER are +// read at fall-through. +// - AuthFromRequest is the source of truth and cascades: request header โ†’ +// ctx headers โ†’ env. +type ctxKey int + +const authHeadersKey ctxKey = 1 + +func WithAuthHeaders(ctx context.Context, headers map[string]string) context.Context { + return context.WithValue(ctx, authHeadersKey, headers) +} + +func AuthFromContext(ctx context.Context) *AuthCtx { + raw, ok := ctx.Value(authHeadersKey).(map[string]string) + if !ok { + return nil + } + out := authCtxFromHeaders(raw) + if out.APIKey == "" && out.Bearer == "" { + return nil + } + return out +} + +// AuthFromEnv reads CREATEOS_API_KEY / CREATEOS_BEARER for stdio transport. +// Returns nil if neither is set. +func AuthFromEnv() *AuthCtx { + out := &AuthCtx{ + APIKey: os.Getenv("CREATEOS_API_KEY"), + Bearer: os.Getenv("CREATEOS_BEARER"), + } + if out.APIKey == "" && out.Bearer == "" { + return nil + } + return out +} + +// AuthFromRequest extracts caller auth headers from the MCP request, matching +// the native handlers/request.go GetAuthInfo behavior. Falls back to +// AuthFromContext for stdio transport. +func AuthFromRequest(ctx context.Context, req mcp.CallToolRequest) *AuthCtx { + out := &AuthCtx{} + if v := req.Header.Get("X-Api-Key"); v != "" { + out.APIKey = v + } + if h := req.Header.Get("Authorization"); h != "" { + parts := strings.SplitN(h, " ", 2) + if len(parts) == 2 && strings.EqualFold(parts[0], "bearer") && parts[1] != "" { + out.Bearer = parts[1] + } + } + if out.APIKey != "" || out.Bearer != "" { + return out + } + if a := AuthFromContext(ctx); a != nil { + return a + } + return AuthFromEnv() +} + +func authCtxFromHeaders(raw map[string]string) *AuthCtx { + out := &AuthCtx{} + for k, v := range raw { + switch strings.ToLower(k) { + case "x-api-key": + out.APIKey = v + case "authorization": + if strings.HasPrefix(strings.ToLower(v), "bearer ") { + out.Bearer = v[len("Bearer "):] + } + } + } + return out +} diff --git a/codemode/auth_test.go b/codemode/auth_test.go new file mode 100644 index 0000000..c1981cb --- /dev/null +++ b/codemode/auth_test.go @@ -0,0 +1,88 @@ +package codemode + +import ( + "context" + "testing" + + "github.com/mark3labs/mcp-go/mcp" +) + +func TestAuthFromContext_APIKey(t *testing.T) { + ctx := WithAuthHeaders(context.Background(), map[string]string{"X-Api-Key": "k1"}) + got := AuthFromContext(ctx) + if got == nil || got.APIKey != "k1" { + t.Fatalf("got %+v", got) + } +} + +func TestAuthFromContext_Bearer(t *testing.T) { + ctx := WithAuthHeaders(context.Background(), map[string]string{"Authorization": "Bearer t1"}) + got := AuthFromContext(ctx) + if got == nil || got.Bearer != "t1" { + t.Fatalf("got %+v", got) + } +} + +func TestAuthFromContext_Both(t *testing.T) { + ctx := WithAuthHeaders(context.Background(), map[string]string{ + "X-Api-Key": "k1", + "Authorization": "Bearer t1", + }) + got := AuthFromContext(ctx) + if got == nil || got.APIKey != "k1" || got.Bearer != "t1" { + t.Fatalf("got %+v", got) + } +} + +func TestAuthFromContext_Missing(t *testing.T) { + if AuthFromContext(context.Background()) != nil { + t.Fatal("want nil") + } +} + +func TestAuthFromRequest_APIKey(t *testing.T) { + req := mcp.CallToolRequest{} + req.Header = map[string][]string{"X-Api-Key": {"k1"}} + got := AuthFromRequest(context.Background(), req) + if got == nil || got.APIKey != "k1" { + t.Fatalf("got %+v", got) + } +} + +func TestAuthFromRequest_Bearer(t *testing.T) { + req := mcp.CallToolRequest{} + req.Header = map[string][]string{"Authorization": {"Bearer tok123"}} + got := AuthFromRequest(context.Background(), req) + if got == nil || got.Bearer != "tok123" { + t.Fatalf("got %+v", got) + } +} + +func TestAuthFromRequest_FallsBackToEnv(t *testing.T) { + t.Setenv("CREATEOS_API_KEY", "env-key") + t.Setenv("CREATEOS_BEARER", "") + req := mcp.CallToolRequest{} + got := AuthFromRequest(context.Background(), req) + if got == nil || got.APIKey != "env-key" { + t.Fatalf("got %+v", got) + } +} + +func TestAuthFromEnv_None(t *testing.T) { + t.Setenv("CREATEOS_API_KEY", "") + t.Setenv("CREATEOS_BEARER", "") + if AuthFromEnv() != nil { + t.Fatal("want nil") + } +} + +func TestAuthFromRequest_FallsBackToContext(t *testing.T) { + t.Setenv("CREATEOS_API_KEY", "") + t.Setenv("CREATEOS_BEARER", "") + req := mcp.CallToolRequest{} + ctx := WithAuthHeaders(context.Background(), map[string]string{"X-Api-Key": "ctx-key"}) + got := AuthFromRequest(ctx, req) + if got == nil || got.APIKey != "ctx-key" { + t.Fatalf("got %+v", got) + } +} diff --git a/codemode/client.go b/codemode/client.go new file mode 100644 index 0000000..d7be990 --- /dev/null +++ b/codemode/client.go @@ -0,0 +1,149 @@ +package codemode + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "time" +) + +type Mode string + +const ( + ModeSearch Mode = "search" + ModeExecute Mode = "execute" +) + +type AuthCtx struct { + APIKey string `json:"apiKey,omitempty"` + Bearer string `json:"bearer,omitempty"` +} + +type RunRequest struct { + Mode Mode `json:"mode"` + Code string `json:"code"` + AuthCtx *AuthCtx `json:"authCtx,omitempty"` +} + +type RunResult struct { + Status string `json:"status"` + Result json.RawMessage `json:"result,omitempty"` + Logs json.RawMessage `json:"logs,omitempty"` + JobID string `json:"jobId,omitempty"` + Error string `json:"error,omitempty"` + ErrorKind string `json:"errorKind,omitempty"` + Stack string `json:"stack,omitempty"` +} + +type Client struct { + baseURL string + http *http.Client +} + +func NewClient(baseURL string) *Client { + return &Client{ + baseURL: baseURL, + http: &http.Client{Timeout: 95 * time.Second}, + } +} + +func (c *Client) Run(ctx context.Context, req RunRequest) (*RunResult, error) { + buf, err := json.Marshal(req) + if err != nil { + return nil, fmt.Errorf("marshal: %w", err) + } + httpReq, err := http.NewRequestWithContext(ctx, http.MethodPost, c.baseURL+"/run", bytes.NewReader(buf)) + if err != nil { + return nil, err + } + httpReq.Header.Set("Content-Type", "application/json") + resp, err := c.http.Do(httpReq) + if err != nil { + return nil, fmt.Errorf("workerd: %w", err) + } + defer resp.Body.Close() + if resp.StatusCode == http.StatusServiceUnavailable { + body, _ := io.ReadAll(resp.Body) + return nil, fmt.Errorf("workerd unavailable: %s", string(body)) + } + var out RunResult + if err := json.NewDecoder(resp.Body).Decode(&out); err != nil { + return nil, fmt.Errorf("decode: %w", err) + } + if resp.StatusCode >= 500 && out.Status == "" { + return nil, errors.New("workerd error: " + resp.Status) + } + return &out, nil +} + +type HealthStats struct { + JobsRunning int `json:"jobsRunning"` + JobStoreSize int `json:"jobStoreSize"` +} + +func (c *Client) HealthStats(ctx context.Context) (*HealthStats, error) { + httpReq, err := http.NewRequestWithContext(ctx, http.MethodGet, c.baseURL+"/health", nil) + if err != nil { + return nil, err + } + resp, err := c.http.Do(httpReq) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if resp.StatusCode != http.StatusOK { + return nil, fmt.Errorf("health %d", resp.StatusCode) + } + var out HealthStats + if err := json.NewDecoder(resp.Body).Decode(&out); err != nil { + return nil, err + } + return &out, nil +} + +type PollRequest struct { + JobID string `json:"jobId"` +} + +func (c *Client) Poll(ctx context.Context, jobID string) (*RunResult, error) { + buf, err := json.Marshal(PollRequest{JobID: jobID}) + if err != nil { + return nil, err + } + httpReq, err := http.NewRequestWithContext(ctx, http.MethodPost, c.baseURL+"/poll", bytes.NewReader(buf)) + if err != nil { + return nil, err + } + httpReq.Header.Set("Content-Type", "application/json") + resp, err := c.http.Do(httpReq) + if err != nil { + return nil, fmt.Errorf("workerd: %w", err) + } + defer resp.Body.Close() + var out RunResult + if err := json.NewDecoder(resp.Body).Decode(&out); err != nil { + return nil, err + } + return &out, nil +} + +func (c *Client) Health(ctx context.Context) error { + httpReq, err := http.NewRequestWithContext(ctx, http.MethodGet, c.baseURL+"/health", nil) + if err != nil { + return err + } + resp, err := c.http.Do(httpReq) + if err != nil { + return err + } + defer resp.Body.Close() + if resp.StatusCode != http.StatusOK { + body, _ := io.ReadAll(resp.Body) + return fmt.Errorf("health %d: %s", resp.StatusCode, string(body)) + } + return nil +} diff --git a/codemode/client_test.go b/codemode/client_test.go new file mode 100644 index 0000000..7df1820 --- /dev/null +++ b/codemode/client_test.go @@ -0,0 +1,83 @@ +package codemode + +import ( + "context" + "encoding/json" + "net/http" + "net/http/httptest" + "strings" + "testing" +) + +func TestClient_Run_Success(t *testing.T) { + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.URL.Path != "/run" || r.Method != "POST" { + t.Fatalf("unexpected %s %s", r.Method, r.URL.Path) + } + var req RunRequest + if err := json.NewDecoder(r.Body).Decode(&req); err != nil { + t.Fatal(err) + } + if req.Mode != ModeSearch { + t.Fatalf("want search, got %s", req.Mode) + } + w.Header().Set("Content-Type", "application/json") + _, _ = w.Write([]byte(`{"status":"done","result":[1,2,3],"logs":[]}`)) + })) + defer srv.Close() + + c := NewClient(srv.URL) + got, err := c.Run(context.Background(), RunRequest{Mode: ModeSearch, Code: "async () => [1,2,3]"}) + if err != nil { + t.Fatal(err) + } + if got.Status != "done" { + t.Fatalf("want done, got %s", got.Status) + } + if !strings.Contains(string(got.Result), "1") { + t.Fatalf("unexpected result %s", got.Result) + } +} + +func TestClient_Run_503(t *testing.T) { + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + w.WriteHeader(http.StatusServiceUnavailable) + _, _ = w.Write([]byte("spec not loaded")) + })) + defer srv.Close() + + c := NewClient(srv.URL) + _, err := c.Run(context.Background(), RunRequest{Mode: ModeSearch, Code: "x"}) + if err == nil { + t.Fatal("want error") + } + if !strings.Contains(err.Error(), "unavailable") { + t.Fatalf("unexpected error: %v", err) + } +} + +func TestClient_Health_OK(t *testing.T) { + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + w.WriteHeader(http.StatusOK) + _, _ = w.Write([]byte(`{"ok":true}`)) + })) + defer srv.Close() + + c := NewClient(srv.URL) + if err := c.Health(context.Background()); err != nil { + t.Fatal(err) + } +} + +func TestClient_Health_503(t *testing.T) { + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + w.WriteHeader(http.StatusServiceUnavailable) + _, _ = w.Write([]byte("not ready")) + })) + defer srv.Close() + + c := NewClient(srv.URL) + if err := c.Health(context.Background()); err == nil { + t.Fatal("want error") + } +} diff --git a/codemode/discovery.go b/codemode/discovery.go new file mode 100644 index 0000000..c29b02f --- /dev/null +++ b/codemode/discovery.go @@ -0,0 +1,239 @@ +package codemode + +import ( + "context" + + "github.com/mark3labs/mcp-go/mcp" +) + +// MCP Resources + Prompts that expose Code Mode usage to clients. +// Tools/list alone tells the model the names; these give it the +// patterns. Pulled on-demand โ€” zero token cost until requested. + +const introContent = `# CreateOS MCP โ€” Code Mode v2 + +This server exposes 10 tools: + + Native fast-path (7): + GetQuotas, GetSupportedProjectTypes, CheckProjectUniqueName, + CreateProject, UploadDeploymentBase64Files, GetDeployment, + CancelDeployment + + Code Mode (3): + search(code) โ€” read-only spec introspection in a JS sandbox + execute(code) โ€” typed CreateOS API calls in a JS sandbox + pollJob(jobId) โ€” drain long-running execute jobs + +The full ~100-endpoint API is reachable via execute. Use search first +to discover an endpoint, then execute to call it. + +## Workflow + +1. search: 'async () => Object.keys(spec.paths).filter(p => p.includes("project"))' +2. search: 'async () => spec.paths["/v1/projects"]' // inspect schema +3. execute: 'async () => (await api.projects.listProjects({limit:5})).data' + +If execute exceeds 90s it returns {status:"running", jobId}; loop +pollJob(jobId) until status != "running". + +## Auth + +Provide X-Api-Key or Authorization: Bearer on the MCP request. +For stdio transport, set CREATEOS_API_KEY or CREATEOS_BEARER env vars. + +## Sandbox + +workerd V8 isolate. No fs, no env, no ambient fetch. Only: + spec โ€” OpenAPI document, $refs resolved, descriptions stripped + api โ€” typed proxy (execute mode only) + console โ€” log/info/warn/error captured into result.logs + sleep โ€” async, capped at 60s per call + +## Limits + + search: 5s timeout + execute: 90s sync window, 600s wall cap, 50 concurrent + jobs: 30 min TTL after terminal, 500 total cap + code: 1 MB + result: 64 KB (oversized truncated with __truncated:true) +` + +const apiShapeContent = `# Code Mode โ€” api shape + +## Typed accessor + + api..(args) + + group = first OpenAPI tag for the operation (lowercase, alnum_). + operationId = exact operationId from the spec. + args = single object. Path params by name; query params by name; + body inferred from remaining keys, or pass {body:{...}} + explicitly. + + Example: + api.projects.getProject({id:"p_abc"}) + api.deployments.createDeployment({projectId:"p_abc", body:{...}}) + +## Escape hatch + + api.raw(method, path, {query, headers, body}) + + Use when an operation lacks an operationId or you need a custom call. + Path MUST be server-relative (starts with "/"); dot-segments rejected. + +## Return shape + + Success: { status, headers, data } data = parsed JSON or raw text. + Failure: throws ApiError { + name: "ApiError", + status: number, // backend HTTP status + body: parsed | string, + path: request path, + } + + Catch in user code if you want to inspect failures without rejecting: + + try { return (await api.foo.listFoo()).data; } + catch (e) { return { kind: e.name, status: e.status, body: e.body }; } + +## Discovering operationIds + + search: 'async () => Object.entries(spec.paths).flatMap(([p,m]) => + Object.entries(m).filter(([k]) => k !== "parameters") + .map(([method, op]) => ({ path:p, method, op:op.operationId, tags:op.tags })) + )' + +## Forbidden + + - Dynamic code evaluation primitives are not exposed; user code is + compiled to a static ESM module. + - fetch โ€” only api/api.raw reach the backend; no other network. + - Set-Cookie / Authorization / X-Api-Key in api.raw headers โ€” stripped. +` + +func newCodeModeResource(uri, name, content string) (mcp.Resource, ResourceHandlerFunc) { + r := mcp.NewResource( + uri, name, + mcp.WithMIMEType("text/markdown"), + mcp.WithResourceDescription("Code Mode reference. Pull on demand."), + ) + body := content + handler := func(ctx context.Context, req mcp.ReadResourceRequest) ([]mcp.ResourceContents, error) { + return []mcp.ResourceContents{ + mcp.TextResourceContents{ + URI: uri, + MIMEType: "text/markdown", + Text: body, + }, + }, nil + } + return r, handler +} + +// ResourceHandlerFunc mirrors server.ResourceHandlerFunc to avoid an import +// cycle on the server package; identical signature. +type ResourceHandlerFunc func(ctx context.Context, req mcp.ReadResourceRequest) ([]mcp.ResourceContents, error) + +// NewIntroResource exposes the high-level Code Mode usage doc. +func NewIntroResource() (mcp.Resource, ResourceHandlerFunc) { + return newCodeModeResource("code-mode://intro", "Code Mode intro + workflow", introContent) +} + +// NewAPIShapeResource exposes the api proxy / ApiError contract. +func NewAPIShapeResource() (mcp.Resource, ResourceHandlerFunc) { + return newCodeModeResource("code-mode://api-shape", "Code Mode api shape + ApiError contract", apiShapeContent) +} + +// Prompts --------------------------------------------------------------- + +const deployExamplePromptText = `You are using CreateOS MCP Code Mode v2. +Goal: deploy a project from an upload and wait for the deployment URL. + +Pattern (single execute call): + + execute({code: 'async () => { + const { data: dep } = await api.deployments.createDeployment({ + projectId: PROJECT_ID, + body: { source: "upload" }, + }); + for (let i = 0; i < 20; i++) { + await sleep(30000); + const { data: s } = await api.deployments.getDeployment({ id: dep.id }); + if (s.status === "deployed") return s.url; + if (s.status === "failed") throw new Error(s.error ?? "deploy failed"); + } + throw new Error("deploy did not complete in 10 min"); + }'}) + +If the call exceeds 90s, the result is {status:"running", jobId}. Loop: + + pollJob({jobId: "j_..."}) + +until status != "running". Each pollJob blocks up to ~90s. + +Replace PROJECT_ID with the real value from CreateProject (native tool) +or api.projects.listProjects().` + +const apiDiscoveryPromptText = `You are using CreateOS MCP Code Mode v2. +Goal: find which endpoints + parameters are relevant to a task. + +Use search (no network, fast): + + // 1. Find paths matching a keyword + search({code: 'async () => Object.keys(spec.paths).filter(p => /domain/i.test(p))'}) + + // 2. Inspect the operations on a path + search({code: 'async () => spec.paths["/v1/domains"]'}) + + // 3. Get the input schema of a specific operation + search({code: 'async () => spec.paths["/v1/domains"].post.requestBody'}) + + // 4. List all operationIds grouped by tag (= api..) + search({code: 'async () => { + const out = {}; + for (const [path, methods] of Object.entries(spec.paths)) { + for (const [m, op] of Object.entries(methods)) { + if (m === "parameters" || !op.operationId) continue; + const tag = (op.tags?.[0] ?? "default"); + (out[tag] ||= []).push({op: op.operationId, method: m.toUpperCase(), path}); + } + } + return out; + }'}) + +Then call execute with api..(args).` + +func NewDeployExamplePrompt() (mcp.Prompt, PromptHandlerFunc) { + p := mcp.NewPrompt( + "code-mode/deploy-example", + mcp.WithPromptDescription("Code Mode pattern: single execute() that deploys + waits, with pollJob fallback."), + ) + handler := func(ctx context.Context, req mcp.GetPromptRequest) (*mcp.GetPromptResult, error) { + return &mcp.GetPromptResult{ + Description: "Deploy + wait pattern using Code Mode execute() and pollJob().", + Messages: []mcp.PromptMessage{ + mcp.NewPromptMessage(mcp.RoleUser, mcp.NewTextContent(deployExamplePromptText)), + }, + }, nil + } + return p, handler +} + +func NewAPIDiscoveryPrompt() (mcp.Prompt, PromptHandlerFunc) { + p := mcp.NewPrompt( + "code-mode/api-discovery", + mcp.WithPromptDescription("Code Mode pattern: 4 search() snippets that walk you from keyword to operationId."), + ) + handler := func(ctx context.Context, req mcp.GetPromptRequest) (*mcp.GetPromptResult, error) { + return &mcp.GetPromptResult{ + Description: "Discover the right operationId via search().", + Messages: []mcp.PromptMessage{ + mcp.NewPromptMessage(mcp.RoleUser, mcp.NewTextContent(apiDiscoveryPromptText)), + }, + }, nil + } + return p, handler +} + +// PromptHandlerFunc mirrors server.PromptHandlerFunc. +type PromptHandlerFunc func(ctx context.Context, req mcp.GetPromptRequest) (*mcp.GetPromptResult, error) diff --git a/codemode/health.go b/codemode/health.go new file mode 100644 index 0000000..b56a02e --- /dev/null +++ b/codemode/health.go @@ -0,0 +1,51 @@ +package codemode + +import ( + "context" + "sync/atomic" + "time" +) + +type HealthMonitor struct { + client *Client + ready atomic.Bool + stop chan struct{} +} + +func NewHealthMonitor(client *Client) *HealthMonitor { + return &HealthMonitor{client: client, stop: make(chan struct{})} +} + +func (h *HealthMonitor) Start(ctx context.Context, interval time.Duration) { + go func() { + t := time.NewTicker(interval) + defer t.Stop() + check := func() { + cctx, cancel := context.WithTimeout(ctx, 2*time.Second) + defer cancel() + stats, err := h.client.HealthStats(cctx) + if err != nil { + h.ready.Store(false) + return + } + h.ready.Store(true) + JobsRunning.Set(float64(stats.JobsRunning)) + JobStoreSize.Set(float64(stats.JobStoreSize)) + } + check() + for { + select { + case <-ctx.Done(): + return + case <-h.stop: + return + case <-t.C: + check() + } + } + }() +} + +func (h *HealthMonitor) Stop() { close(h.stop) } + +func (h *HealthMonitor) Ready() bool { return h.ready.Load() } diff --git a/codemode/integration_test.go b/codemode/integration_test.go new file mode 100644 index 0000000..c7b5780 --- /dev/null +++ b/codemode/integration_test.go @@ -0,0 +1,173 @@ +//go:build integration + +package codemode_test + +import ( + "context" + "encoding/json" + "net/http" + "net/http/httptest" + "os" + "os/exec" + "path/filepath" + "strings" + "testing" + "time" + + "github.com/NodeOps-app/createos-mcp/codemode" +) + +func startBackend(t *testing.T) *httptest.Server { + t.Helper() + yamlBytes, err := os.ReadFile("testdata/openapi-mini.yaml") + if err != nil { + t.Fatal(err) + } + mux := http.NewServeMux() + mux.HandleFunc("/api-docs/openapi.yaml", func(w http.ResponseWriter, _ *http.Request) { + w.Header().Set("Content-Type", "application/yaml") + _, _ = w.Write(yamlBytes) + }) + mux.HandleFunc("/v1/foo", func(w http.ResponseWriter, r *http.Request) { + if r.Header.Get("X-Api-Key") != "test-key" { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusUnauthorized) + _, _ = w.Write([]byte(`{"error":"missing api key"}`)) + return + } + w.Header().Set("Content-Type", "application/json") + _, _ = w.Write([]byte(`{"items":[{"id":"f1"}]}`)) + }) + srv := httptest.NewServer(mux) + t.Cleanup(srv.Close) + return srv +} + +func startWorkerd(t *testing.T, backendURL string) (string, func()) { + t.Helper() + wd, _ := filepath.Abs("workerd") + // Build the bundled spec-loader so workerd can embed it. + build := exec.Command("bun", "run", "build") + build.Dir = wd + if out, err := build.CombinedOutput(); err != nil { + t.Fatalf("bun build failed: %v\n%s", err, out) + } + cmd := exec.Command("./node_modules/.bin/workerd", "serve", "--experimental", "config.capnp") + cmd.Dir = wd + cmd.Env = append(os.Environ(), "BACKEND_URL="+backendURL) + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + if err := cmd.Start(); err != nil { + t.Fatal(err) + } + cancel := func() { + if cmd.Process == nil { + return + } + _ = cmd.Process.Kill() + // Reap so the OS port + pid table are clean before the next test + // (workerd binds a fixed loopback port; concurrent/back-to-back + // integration tests would otherwise collide). + _, _ = cmd.Process.Wait() + // Belt-and-braces: socket close lags pid reap on macOS. + time.Sleep(100 * time.Millisecond) + } + t.Cleanup(cancel) + deadline := time.Now().Add(15 * time.Second) + c := codemode.NewClient("http://127.0.0.1:8787") + for time.Now().Before(deadline) { + if err := c.Health(context.Background()); err == nil { + return "http://127.0.0.1:8787", cancel + } + time.Sleep(200 * time.Millisecond) + } + cancel() + t.Fatal("workerd never became healthy") + return "", cancel +} + +func TestIntegration_Search(t *testing.T) { + if os.Getenv("CODEMODE_INTEGRATION") == "" { + t.Skip("set CODEMODE_INTEGRATION=1 to run") + } + backend := startBackend(t) + url, _ := startWorkerd(t, backend.URL) + c := codemode.NewClient(url) + + res, err := c.Run(context.Background(), codemode.RunRequest{ + Mode: codemode.ModeSearch, + Code: "async () => Object.keys(spec.paths)", + }) + if err != nil { + t.Fatal(err) + } + if res.Status != "done" { + t.Fatalf("status = %q error = %q", res.Status, res.Error) + } + var paths []string + if err := json.Unmarshal(res.Result, &paths); err != nil { + t.Fatal(err) + } + if len(paths) == 0 || !strings.HasPrefix(paths[0], "/") { + t.Fatalf("unexpected paths %v", paths) + } +} + +func TestIntegration_Execute(t *testing.T) { + if os.Getenv("CODEMODE_INTEGRATION") == "" { + t.Skip("set CODEMODE_INTEGRATION=1 to run") + } + backend := startBackend(t) + url, _ := startWorkerd(t, backend.URL) + c := codemode.NewClient(url) + + res, err := c.Run(context.Background(), codemode.RunRequest{ + Mode: codemode.ModeExecute, + Code: "async () => (await api.foo.listFoo()).data.items[0].id", + AuthCtx: &codemode.AuthCtx{APIKey: "test-key"}, + }) + if err != nil { + t.Fatal(err) + } + if res.Status != "done" { + t.Fatalf("status=%q error=%q", res.Status, res.Error) + } + var id string + if err := json.Unmarshal(res.Result, &id); err != nil { + t.Fatal(err) + } + if id != "f1" { + t.Fatalf("id=%q", id) + } +} + +func TestIntegration_Execute_AuthError(t *testing.T) { + if os.Getenv("CODEMODE_INTEGRATION") == "" { + t.Skip("set CODEMODE_INTEGRATION=1 to run") + } + backend := startBackend(t) + url, _ := startWorkerd(t, backend.URL) + c := codemode.NewClient(url) + + res, err := c.Run(context.Background(), codemode.RunRequest{ + Mode: codemode.ModeExecute, + Code: "async () => { try { return (await api.foo.listFoo()).data; } catch (e) { return {kind: e.name, status: e.status}; } }", + AuthCtx: &codemode.AuthCtx{APIKey: "wrong"}, + }) + if err != nil { + t.Fatal(err) + } + if res.Status != "done" { + t.Fatalf("status=%q error=%q", res.Status, res.Error) + } + var got struct { + Kind string `json:"kind"` + Status int `json:"status"` + } + if err := json.Unmarshal(res.Result, &got); err != nil { + t.Fatal(err) + } + if got.Kind != "ApiError" || got.Status != 401 { + t.Fatalf("unexpected %+v", got) + } +} diff --git a/codemode/metrics.go b/codemode/metrics.go new file mode 100644 index 0000000..4a68057 --- /dev/null +++ b/codemode/metrics.go @@ -0,0 +1,30 @@ +package codemode + +import ( + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promauto" +) + +var ( + RunDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{ + Name: "codemode_run_duration_seconds", + Help: "Duration of code-mode tool calls.", + Buckets: prometheus.DefBuckets, + }, []string{"mode", "outcome"}) + + JobsRunning = promauto.NewGauge(prometheus.GaugeOpts{ + Name: "codemode_jobs_running", + Help: "Number of running jobs in the workerd job store.", + }) + + JobStoreSize = promauto.NewGauge(prometheus.GaugeOpts{ + Name: "codemode_jobstore_size", + Help: "Total entries in the workerd job store.", + }) + + APICallDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{ + Name: "codemode_api_call_duration_seconds", + Help: "Duration of api-proxy backend calls.", + Buckets: prometheus.DefBuckets, + }, []string{"status"}) +) diff --git a/codemode/poll_test.go b/codemode/poll_test.go new file mode 100644 index 0000000..d0a011d --- /dev/null +++ b/codemode/poll_test.go @@ -0,0 +1,47 @@ +package codemode + +import ( + "context" + "encoding/json" + "net/http" + "net/http/httptest" + "testing" +) + +func TestClient_Poll_Done(t *testing.T) { + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.URL.Path != "/poll" { + t.Fatalf("unexpected path %s", r.URL.Path) + } + var body PollRequest + _ = json.NewDecoder(r.Body).Decode(&body) + if body.JobID != "j1" { + t.Fatalf("got jobId %q", body.JobID) + } + _, _ = w.Write([]byte(`{"status":"done","result":"x"}`)) + })) + defer srv.Close() + c := NewClient(srv.URL) + got, err := c.Poll(context.Background(), "j1") + if err != nil { + t.Fatal(err) + } + if got.Status != "done" { + t.Fatalf("status=%q", got.Status) + } +} + +func TestClient_Poll_JobMissing(t *testing.T) { + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + _, _ = w.Write([]byte(`{"status":"error","errorKind":"jobMissing","error":"unknown jobId"}`)) + })) + defer srv.Close() + c := NewClient(srv.URL) + got, err := c.Poll(context.Background(), "j1") + if err != nil { + t.Fatal(err) + } + if got.ErrorKind != "jobMissing" { + t.Fatalf("errorKind=%q", got.ErrorKind) + } +} diff --git a/codemode/testdata/openapi-mini.yaml b/codemode/testdata/openapi-mini.yaml new file mode 100644 index 0000000..edccc8e --- /dev/null +++ b/codemode/testdata/openapi-mini.yaml @@ -0,0 +1,24 @@ +openapi: 3.0.0 +info: + title: test + version: 1.0.0 +paths: + /v1/foo: + get: + operationId: listFoo + tags: [foo] + description: should be stripped + responses: + '200': + $ref: '#/components/responses/Ok' +components: + responses: + Ok: + description: ok response + content: + application/json: + schema: + type: object + properties: + items: + type: array diff --git a/codemode/tools.go b/codemode/tools.go new file mode 100644 index 0000000..8077bd8 --- /dev/null +++ b/codemode/tools.go @@ -0,0 +1,220 @@ +package codemode + +import ( + "context" + "encoding/json" + "fmt" + "time" + + "github.com/mark3labs/mcp-go/mcp" +) + +func observe(mode Mode, outcome string, start time.Time) { + RunDuration.WithLabelValues(string(mode), outcome).Observe(time.Since(start).Seconds()) +} + +func outcomeFromResult(r *RunResult) string { + switch r.Status { + case "done": + return "success" + case "running": + return "async" + case "error": + if r.ErrorKind != "" { + return r.ErrorKind + } + return "user_error" + default: + return "unknown" + } +} + +const searchInputSchema = `{ + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Async arrow fn. Globals: spec, console, sleep. Example: 'async () => Object.entries(spec.paths).filter(([p]) => p.includes(\"deploy\")).map(([p,m]) => ({path:p, ops:Object.keys(m)}))'." + } + }, + "required": ["code"] +}` + +const searchToolDescription = `Code Mode: introspect the CreateOS OpenAPI spec from a sandboxed JS arrow fn. + +When: discover endpoints/params/schemas BEFORE calling execute. No network in this mode. + +Globals: spec ($refs resolved, descriptions stripped), console, sleep(ms). +Result envelope: {status:"done"|"error", result, logs} | {status:"error", errorKind:"userCode"|"timeout"|"infra", error, stack}. +Limits: 5s timeout, 1MB code, 64KB result. + +See resource code-mode://intro and prompt code-mode/api-discovery.` + +func toolMeta() *mcp.Meta { + return &mcp.Meta{ + AdditionalFields: map[string]any{ + "mode": "code", + "sandbox": "workerd", + "version": "v2", + }, + } +} + +func NewSearchTool() mcp.Tool { + t := mcp.NewToolWithRawSchema("search", searchToolDescription, []byte(searchInputSchema)) + t.Meta = toolMeta() + return t +} + +type Handler struct { + Client *Client +} + +func (h *Handler) Search(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error) { + start := time.Now() + outcome := "bad_input" + defer func() { observe(ModeSearch, outcome, start) }() + + args, ok := req.Params.Arguments.(map[string]interface{}) + if !ok { + return mcp.NewToolResultError("invalid arguments type"), nil + } + rawCode, ok := args["code"] + if !ok { + return mcp.NewToolResultError("missing required argument: code"), nil + } + code, ok := rawCode.(string) + if !ok { + return mcp.NewToolResultError("code must be a string"), nil + } + result, err := h.Client.Run(ctx, RunRequest{Mode: ModeSearch, Code: code}) + if err != nil { + outcome = "infra" + return mcp.NewToolResultError(fmt.Sprintf("code mode unavailable: %v", err)), nil + } + outcome = outcomeFromResult(result) + out, err := json.Marshal(result) + if err != nil { + outcome = "encode" + return mcp.NewToolResultError(fmt.Sprintf("encode: %v", err)), nil + } + return mcp.NewToolResultText(string(out)), nil +} + +const pollJobInputSchema = `{ + "type": "object", + "properties": { + "jobId": { + "type": "string", + "description": "j_ from a prior execute() that returned status:'running'." + } + }, + "required": ["jobId"] +}` + +const pollJobToolDescription = `Code Mode: drain a long-running execute() job. + +When: a prior execute() returned {status:"running", jobId}. Loop until status != "running". +Blocks up to ~90s per call (long-poll). + +Result envelope: {status:"running", jobId, logsSoFar} | {status:"done", result, logs} | {status:"error", errorKind:"userCode"|"timeout"|"infra"|"jobMissing", error, stack}. +Wall cap on the underlying job: 600s. Jobs evicted 30 min after terminal.` + +func NewPollJobTool() mcp.Tool { + t := mcp.NewToolWithRawSchema("pollJob", pollJobToolDescription, []byte(pollJobInputSchema)) + t.Meta = toolMeta() + return t +} + +func (h *Handler) PollJob(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error) { + args, ok := req.Params.Arguments.(map[string]interface{}) + if !ok { + return mcp.NewToolResultError("invalid arguments type"), nil + } + rawID, ok := args["jobId"] + if !ok { + return mcp.NewToolResultError("missing required argument: jobId"), nil + } + jobID, ok := rawID.(string) + if !ok || jobID == "" { + return mcp.NewToolResultError("jobId must be a non-empty string"), nil + } + result, err := h.Client.Poll(ctx, jobID) + if err != nil { + return mcp.NewToolResultError(fmt.Sprintf("code mode unavailable: %v", err)), nil + } + out, err := json.Marshal(result) + if err != nil { + return mcp.NewToolResultError(fmt.Sprintf("encode: %v", err)), nil + } + return mcp.NewToolResultText(string(out)), nil +} + +const executeInputSchema = `{ + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Async arrow fn. Globals: spec, api, console, sleep. Example: 'async () => { const {data} = await api.projects.listProjects({limit:5}); return data; }'. Or escape hatch: 'async () => (await api.raw(\"POST\",\"/v1/x\",{body:{...}})).body'." + } + }, + "required": ["code"] +}` + +const executeToolDescription = `Code Mode: run JS against the CreateOS API in a fresh V8 isolate. Auth forwarded from caller. + +API shape: + api..(args) typed call; group = first OpenAPI tag, operationId from spec. + api.raw(method, path, {query, headers, body}) escape hatch for unmapped routes. + Path params come from args by name: api.projects.getProject({id:"..."}). + Query/body inferred from operation; pass {body:{...}} explicitly to override. + +Errors: non-2xx throws ApiError {name, status, body, path}. Catch in user code if you want to handle them. + +Result envelope: + sync -> {status:"done", result, logs} + >90s -> {status:"running", jobId} -> loop pollJob(jobId) + failure -> {status:"error", errorKind:"userCode"|"timeout"|"infra"|"capacity", error, stack, logs} + +Limits: 90s sync window, 600s wall cap, 1MB code, 64KB result, 50 concurrent jobs. +Sandbox: no fs, no env, no ambient fetch. Only api/console/sleep/spec. + +See resource code-mode://api-shape and prompt code-mode/deploy-example.` + +func NewExecuteTool() mcp.Tool { + t := mcp.NewToolWithRawSchema("execute", executeToolDescription, []byte(executeInputSchema)) + t.Meta = toolMeta() + return t +} + +func (h *Handler) Execute(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error) { + start := time.Now() + outcome := "bad_input" + defer func() { observe(ModeExecute, outcome, start) }() + + args, ok := req.Params.Arguments.(map[string]interface{}) + if !ok { + return mcp.NewToolResultError("invalid arguments type"), nil + } + rawCode, ok := args["code"] + if !ok { + return mcp.NewToolResultError("missing required argument: code"), nil + } + code, ok := rawCode.(string) + if !ok { + return mcp.NewToolResultError("code must be a string"), nil + } + auth := AuthFromRequest(ctx, req) + result, err := h.Client.Run(ctx, RunRequest{Mode: ModeExecute, Code: code, AuthCtx: auth}) + if err != nil { + outcome = "infra" + return mcp.NewToolResultError(fmt.Sprintf("code mode unavailable: %v", err)), nil + } + outcome = outcomeFromResult(result) + out, err := json.Marshal(result) + if err != nil { + outcome = "encode" + return mcp.NewToolResultError(fmt.Sprintf("encode: %v", err)), nil + } + return mcp.NewToolResultText(string(out)), nil +} diff --git a/codemode/tools_test.go b/codemode/tools_test.go new file mode 100644 index 0000000..01a6029 --- /dev/null +++ b/codemode/tools_test.go @@ -0,0 +1,120 @@ +package codemode + +import ( + "context" + "encoding/json" + "net/http" + "net/http/httptest" + "strings" + "testing" + + "github.com/mark3labs/mcp-go/mcp" +) + +func TestHandler_Search_Success(t *testing.T) { + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + _, _ = w.Write([]byte(`{"status":"done","result":["a","b"],"logs":[]}`)) + })) + defer srv.Close() + + h := &Handler{Client: NewClient(srv.URL)} + tool := NewSearchTool() + if tool.Name != "search" { + t.Fatalf("name = %q", tool.Name) + } + + req := mcp.CallToolRequest{} + req.Params.Arguments = map[string]interface{}{"code": "async () => spec"} + res, err := h.Search(context.Background(), req) + if err != nil { + t.Fatal(err) + } + if res.IsError { + t.Fatalf("unexpected error result: %#v", res.Content) + } + got, ok := res.Content[0].(mcp.TextContent) + if !ok { + t.Fatalf("not text content: %T", res.Content[0]) + } + var parsed RunResult + if err := json.Unmarshal([]byte(got.Text), &parsed); err != nil { + t.Fatal(err) + } + if parsed.Status != "done" { + t.Fatalf("status = %q", parsed.Status) + } +} + +func TestHandler_Execute_ForwardsAuth(t *testing.T) { + var seen RunRequest + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + _ = json.NewDecoder(r.Body).Decode(&seen) + _, _ = w.Write([]byte(`{"status":"done","result":1}`)) + })) + defer srv.Close() + + h := &Handler{Client: NewClient(srv.URL)} + ctx := WithAuthHeaders(context.Background(), map[string]string{"X-Api-Key": "k"}) + req := mcp.CallToolRequest{} + req.Params.Arguments = map[string]interface{}{"code": "async () => 1"} + res, err := h.Execute(ctx, req) + if err != nil { + t.Fatal(err) + } + if res.IsError { + t.Fatalf("unexpected error: %#v", res.Content) + } + if seen.Mode != ModeExecute { + t.Fatalf("mode %q", seen.Mode) + } + if seen.AuthCtx == nil || seen.AuthCtx.APIKey != "k" { + t.Fatalf("authCtx %+v", seen.AuthCtx) + } +} + +func TestHandler_PollJob_OK(t *testing.T) { + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + _, _ = w.Write([]byte(`{"status":"done","result":1}`)) + })) + defer srv.Close() + h := &Handler{Client: NewClient(srv.URL)} + req := mcp.CallToolRequest{} + req.Params.Arguments = map[string]interface{}{"jobId": "j1"} + res, err := h.PollJob(context.Background(), req) + if err != nil { + t.Fatal(err) + } + if res.IsError { + t.Fatalf("unexpected error: %#v", res.Content) + } +} + +func TestHandler_PollJob_MissingId(t *testing.T) { + h := &Handler{Client: NewClient("http://invalid")} + req := mcp.CallToolRequest{} + req.Params.Arguments = map[string]interface{}{} + res, err := h.PollJob(context.Background(), req) + if err != nil { + t.Fatal(err) + } + if !res.IsError { + t.Fatal("want error") + } +} + +func TestHandler_Search_MissingCode(t *testing.T) { + h := &Handler{Client: NewClient("http://invalid")} + req := mcp.CallToolRequest{} + req.Params.Arguments = map[string]interface{}{} + res, err := h.Search(context.Background(), req) + if err != nil { + t.Fatal(err) + } + if !res.IsError { + t.Fatal("want error") + } + got := res.Content[0].(mcp.TextContent).Text + if !strings.Contains(got, "code") { + t.Fatalf("unexpected msg: %s", got) + } +} diff --git a/codemode/workerd/.gitignore b/codemode/workerd/.gitignore new file mode 100644 index 0000000..8b69f3a --- /dev/null +++ b/codemode/workerd/.gitignore @@ -0,0 +1,3 @@ +node_modules/ +dist/ +.cache/ diff --git a/codemode/workerd/Dockerfile b/codemode/workerd/Dockerfile new file mode 100644 index 0000000..dc05e3e --- /dev/null +++ b/codemode/workerd/Dockerfile @@ -0,0 +1,24 @@ +FROM oven/bun:1 AS deps +WORKDIR /app +COPY package.json bun.lock* ./ +RUN bun install --frozen-lockfile + +FROM oven/bun:1 AS build +WORKDIR /app +COPY --from=deps /app/node_modules ./node_modules +COPY . . +RUN bun run build + +FROM debian:bookworm-slim +RUN apt-get update && apt-get install -y --no-install-recommends \ + libssl3 ca-certificates \ + && rm -rf /var/lib/apt/lists/* \ + && groupadd --system codemode --gid 65532 \ + && useradd --system --uid 65532 --gid 65532 --no-create-home --shell /sbin/nologin codemode +WORKDIR /app +COPY --from=build /app/node_modules ./node_modules +COPY --from=build /app/dist ./dist +COPY config.capnp dispatcher.js host.js api-proxy.js api-sdk-builder.js ./ +USER codemode +EXPOSE 8787 +ENTRYPOINT ["./node_modules/.bin/workerd", "serve", "--experimental", "config.capnp"] diff --git a/codemode/workerd/api-proxy.js b/codemode/workerd/api-proxy.js new file mode 100644 index 0000000..6c69c80 --- /dev/null +++ b/codemode/workerd/api-proxy.js @@ -0,0 +1,222 @@ +const BOOTSTRAP_PATH = "/api-docs/openapi.yaml"; +const PROXY_TIMEOUT_MS = 12_000; + +// Backend-bound headers the sandbox is allowed to set. Anything else +// (auth, host, cookie, internal x-* headers) is rejected so user code +// cannot override credentials or smuggle internal state. +const SAFE_REQUEST_HEADERS = new Set([ + "accept", + "accept-encoding", + "accept-language", + "content-type", + "if-match", + "if-none-match", + "if-modified-since", + "if-unmodified-since", + "x-request-id", +]); +// Note: x-api-key, x-access-token, authorization, cookie are intentionally +// NOT in the request allowlist. They are credential headers populated only +// by buildAuthHeaders from the trusted authCtx โ€” user code must never be +// able to inject them via the request `headers` field. + +// Response headers we relay back to user code. Strips Set-Cookie and any +// x-internal-*, x-vault-*, x-sentinel-* style headers so backend internals +// never leak into the sandbox. +const SAFE_RESPONSE_HEADERS = new Set([ + "content-type", + "content-length", + "content-encoding", + "etag", + "last-modified", + "cache-control", + "date", + "x-request-id", +]); + +// Auth header names match the native Go client (helpers/httpclient.go): +// api-key -> "X-Api-Key" +// bearer -> "X-Access-Token" (NOT "Authorization: Bearer" โ€” backend +// accepts the X-Access-Token header used by the native +// handlers; using Authorization here would silently fail +// on Bearer-authenticated callers.) +function buildAuthHeaders(authCtx) { + const headers = {}; + if (!authCtx) return headers; + if (authCtx.apiKey) headers["X-Api-Key"] = authCtx.apiKey; + if (authCtx.bearer) headers["X-Access-Token"] = authCtx.bearer; + return headers; +} + +function sanitizeRequestHeaders(headers) { + const out = {}; + if (!headers || typeof headers !== "object") return out; + for (const [k, v] of Object.entries(headers)) { + if (typeof k !== "string" || typeof v !== "string") continue; + if (SAFE_REQUEST_HEADERS.has(k.toLowerCase())) out[k] = v; + } + return out; +} + +function sanitizeResponseHeaders(h) { + const out = {}; + for (const [k, v] of h) { + if (SAFE_RESPONSE_HEADERS.has(k.toLowerCase())) out[k] = v; + } + return out; +} + +// Path validation + base path preservation. +// - request `path` MUST start with single "/" (rejects "https://..." SSRF +// and "//attacker" protocol-relative). +// - if BACKEND_URL has a path prefix (e.g. "https://host/api"), the prefix +// is preserved and the request path is appended: prefix + path. +// - bootstrap path ("/api-docs/openapi.yaml") in api-proxy bootstrap mode +// uses the same prefix-aware concatenation via raw `env.BACKEND_URL + +// path`, which is fine when BACKEND_URL has no trailing slash. +function buildUrl(base, path, query) { + if (typeof path !== "string" || !path.startsWith("/") || path.startsWith("//")) { + throw new Error("path must be a server-relative path starting with '/'"); + } + // Reject dot-segments โ€” both raw and percent-encoded. URL normalisation + // collapses "/api/../admin" (and "/api/%2e%2e/admin", "/api/%2E./admin", + // etc., because RFC 3986 ยง3.3 treats percent-encoded "." as identical + // to literal ".") to "/admin", which would let user code escape any + // BACKEND_URL path prefix and reach unrelated routes. + const [pathOnly, reqQuery] = path.split("?", 2); + for (const seg of pathOnly.split("/")) { + let decoded; + try { + decoded = decodeURIComponent(seg); + } catch { + throw new Error("path contains invalid percent-encoding"); + } + if (decoded === "." || decoded === "..") { + throw new Error("path may not contain '.' or '..' segments (raw or encoded)"); + } + } + const baseUrl = new URL(base); + // Strip any trailing slash on the base path so we don't end up with "//". + const basePath = baseUrl.pathname.replace(/\/+$/, ""); + baseUrl.pathname = basePath + pathOnly; + if (reqQuery !== undefined) baseUrl.search = "?" + reqQuery; + if (query && typeof query === "object") { + for (const [k, v] of Object.entries(query)) { + if (v == null) continue; + if (Array.isArray(v)) { + for (const item of v) baseUrl.searchParams.append(k, String(item)); + } else { + baseUrl.searchParams.set(k, String(v)); + } + } + } + return baseUrl.toString(); +} + +export default { + async fetch(req, env) { + let body; + try { + body = await req.json(); + } catch { + return Response.json({ error: "invalid json body" }, { status: 400 }); + } + const { mode, method, path, headers = {}, query, body: reqBody, authCtx } = body; + + if (mode === "bootstrap") { + if (method !== "GET" || path !== BOOTSTRAP_PATH) { + return Response.json( + { error: "bootstrap mode only allows GET " + BOOTSTRAP_PATH }, + { status: 400 }, + ); + } + // Use buildUrl so a BACKEND_URL with a path prefix is honoured. + let bootUrl; + try { + bootUrl = buildUrl(env.BACKEND_URL, path, null); + } catch (e) { + return Response.json({ error: String(e?.message ?? e) }, { status: 400 }); + } + const r = await fetch(bootUrl, { method: "GET" }); + const text = await r.text(); + return Response.json({ + status: r.status, + headers: Object.fromEntries(r.headers), + body: text, + }); + } + + if (mode !== "authenticated") { + return Response.json({ error: "unknown mode: " + mode }, { status: 400 }); + } + + let url; + try { + url = buildUrl(env.BACKEND_URL, path, query); + } catch (e) { + return Response.json({ error: String(e?.message ?? e) }, { status: 400 }); + } + + // Auth headers MUST be applied last so sanitised user headers cannot + // override X-Api-Key / Authorization. SAFE_REQUEST_HEADERS already + // excludes those, but the spread order is the second line of defence. + const finalHeaders = { + ...sanitizeRequestHeaders(headers), + ...buildAuthHeaders(authCtx), + }; + if (reqBody != null && !finalHeaders["content-type"] && !finalHeaders["Content-Type"]) { + finalHeaders["Content-Type"] = "application/json"; + } + const init = { + method: method ?? "GET", + headers: finalHeaders, + }; + if (reqBody != null) { + init.body = typeof reqBody === "string" ? reqBody : JSON.stringify(reqBody); + } + + const ac = new AbortController(); + const t = setTimeout(() => ac.abort(), PROXY_TIMEOUT_MS); + init.signal = ac.signal; + + let resp; + try { + resp = await fetch(url, init); + } catch (e) { + clearTimeout(t); + const isAbort = e?.name === "AbortError"; + return Response.json({ + kind: isAbort ? "timeout" : "network", + error: String(e?.message ?? e), + }, { status: 502 }); + } + clearTimeout(t); + + const contentType = resp.headers.get("content-type") ?? ""; + // Always read text first. resp.json() consumes the body, so a + // resp.text() fallback would throw "body already used" if the JSON + // parse failed mid-stream. Reading text once and parsing in-process + // avoids that. + let dataBody; + let raw; + try { + raw = await resp.text(); + } catch (e) { + raw = ``; + } + if (contentType.includes("application/json")) { + try { + dataBody = JSON.parse(raw); + } catch { + dataBody = raw; + } + } else { + dataBody = raw; + } + return Response.json({ + status: resp.status, + headers: sanitizeResponseHeaders(resp.headers), + body: dataBody, + }); + }, +}; diff --git a/codemode/workerd/api-sdk-builder.js b/codemode/workerd/api-sdk-builder.js new file mode 100644 index 0000000..5b61c82 --- /dev/null +++ b/codemode/workerd/api-sdk-builder.js @@ -0,0 +1,85 @@ +// Mirrors scripts/gen-sdk.ts but operates on in-memory spec. +// Returns an ESM source string defining buildApi(callback) โ†’ typed proxy +// keyed by tag.operationId, with `raw(method, path, opts)` escape hatch. + +function collectOps(spec) { + const ops = []; + for (const [path, methods] of Object.entries(spec.paths ?? {})) { + for (const [method, raw] of Object.entries(methods)) { + if (method === "parameters" || typeof raw !== "object" || raw === null) continue; + const op = raw; + if (!op.operationId) continue; + const group = (op.tags?.[0] ?? "default").replace(/[^a-zA-Z0-9_]/g, ""); + ops.push({ + operationId: op.operationId, + method: method.toUpperCase(), + path, + group, + paramsIn: (op.parameters ?? []).map((p) => ({ + in: p.in, name: p.name, required: !!p.required, + })), + hasBody: !!op.requestBody, + }); + } + } + return ops; +} + +export function buildSdkModule(spec) { + const ops = collectOps(spec); + const groups = {}; + for (const op of ops) (groups[op.group] ??= []).push(op); + + const lines = []; + lines.push(`function __operation(callback, op) { + return async function (args = {}) { + const path = op.path.replace(/\\{([^}]+)\\}/g, (_, name) => { + const v = args[name]; + if (v == null) throw new Error("missing path param: " + name); + return encodeURIComponent(String(v)); + }); + const query = {}; + let body; + for (const p of op.paramsIn) { + if (p.in === "query" && args[p.name] !== undefined) query[p.name] = args[p.name]; + } + if (op.hasBody && args.body !== undefined) body = args.body; + else if (op.hasBody) { + const inferred = {}; + for (const [k, v] of Object.entries(args)) { + if (op.paramsIn.some((p) => p.name === k)) continue; + if (k === "body") continue; + inferred[k] = v; + } + body = inferred; + } + const res = await callback({ method: op.method, path, query, body }); + if (res.status >= 400) { + const err = new Error("ApiError " + res.status + " " + op.method + " " + path); + err.name = "ApiError"; + err.status = res.status; + err.body = res.body; + err.path = path; + throw err; + } + return { status: res.status, headers: res.headers, data: res.body }; + }; + }`); + lines.push(""); + lines.push("export function buildApi(callback) {"); + lines.push(" return {"); + for (const [group, list] of Object.entries(groups)) { + lines.push(` ${JSON.stringify(group)}: {`); + for (const op of list) { + const meta = JSON.stringify({ + method: op.method, path: op.path, paramsIn: op.paramsIn, hasBody: op.hasBody, + }); + lines.push(` ${JSON.stringify(op.operationId)}: __operation(callback, ${meta}),`); + } + lines.push(" },"); + } + lines.push(" raw: (method, path, opts = {}) => callback({ method, path, ...opts }),"); + lines.push(" };"); + lines.push("}"); + return lines.join("\n"); +} diff --git a/codemode/workerd/bun.lock b/codemode/workerd/bun.lock new file mode 100644 index 0000000..7a3a09d --- /dev/null +++ b/codemode/workerd/bun.lock @@ -0,0 +1,37 @@ +{ + "lockfileVersion": 1, + "configVersion": 1, + "workspaces": { + "": { + "name": "createos-mcp-codemode", + "devDependencies": { + "@types/bun": "latest", + "workerd": "^1.20240909.0", + "yaml": "^2.5.0", + }, + }, + }, + "packages": { + "@cloudflare/workerd-darwin-64": ["@cloudflare/workerd-darwin-64@1.20260425.1", "", { "os": "darwin", "cpu": "x64" }, "sha512-YKv3CPcrNGA07BhbndR55wbDw+B7uOgTQ++vRqAxeP6dXT+tFVvU5/TsH+JEVeuxP8ZTKtzOkrQiY6DvIOVU2g=="], + + "@cloudflare/workerd-darwin-arm64": ["@cloudflare/workerd-darwin-arm64@1.20260425.1", "", { "os": "darwin", "cpu": "arm64" }, "sha512-hoafCorJZpreMn7LGv3QYCWV9IbDUDnARMzVIyMNjGNcobPMXdtpl84crXqcw/9GJGMCXtQFaqdpxKoq++2Uig=="], + + "@cloudflare/workerd-linux-64": ["@cloudflare/workerd-linux-64@1.20260425.1", "", { "os": "linux", "cpu": "x64" }, "sha512-dK091aX+tedBp0EAt/q3DlR5flpOu9Y9rFxdG58HDxvJ694VAEnGJXI8Y5a3PpwcKW9N2HCfoyWrmxvudcJukw=="], + + "@cloudflare/workerd-linux-arm64": ["@cloudflare/workerd-linux-arm64@1.20260425.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-16q5fQL4qm0odQUcs8gWMIGpTjXdiZcAaYLJOhdSeAua/v2Z/EZOldXeUt8We1C90HHG7DbnixKLsqoWn4QhVQ=="], + + "@cloudflare/workerd-windows-64": ["@cloudflare/workerd-windows-64@1.20260425.1", "", { "os": "win32", "cpu": "x64" }, "sha512-Ccn5DhLRz64dmoEIXe6dzil481gyXnhjT2fISwswMBQkBZlTjybhsWdJtlpICaNduwZHPfesnKGfbDclQweBzw=="], + + "@types/bun": ["@types/bun@1.3.13", "", { "dependencies": { "bun-types": "1.3.13" } }, "sha512-9fqXWk5YIHGGnUau9TEi+qdlTYDAnOj+xLCmSTwXfAIqXr2x4tytJb43E9uCvt09zJURKXwAtkoH4nLQfzeTXw=="], + + "@types/node": ["@types/node@25.6.0", "", { "dependencies": { "undici-types": "~7.19.0" } }, "sha512-+qIYRKdNYJwY3vRCZMdJbPLJAtGjQBudzZzdzwQYkEPQd+PJGixUL5QfvCLDaULoLv+RhT3LDkwEfKaAkgSmNQ=="], + + "bun-types": ["bun-types@1.3.13", "", { "dependencies": { "@types/node": "*" } }, "sha512-QXKeHLlOLqQX9LgYaHJfzdBaV21T63HhFJnvuRCcjZiaUDpbs5ED1MgxbMra71CsryN/1dAoXuJJJwIv/2drVA=="], + + "undici-types": ["undici-types@7.19.2", "", {}, "sha512-qYVnV5OEm2AW8cJMCpdV20CDyaN3g0AjDlOGf1OW4iaDEx8MwdtChUp4zu4H0VP3nDRF/8RKWH+IPp9uW0YGZg=="], + + "workerd": ["workerd@1.20260425.1", "", { "optionalDependencies": { "@cloudflare/workerd-darwin-64": "1.20260425.1", "@cloudflare/workerd-darwin-arm64": "1.20260425.1", "@cloudflare/workerd-linux-64": "1.20260425.1", "@cloudflare/workerd-linux-arm64": "1.20260425.1", "@cloudflare/workerd-windows-64": "1.20260425.1" }, "bin": { "workerd": "bin/workerd" } }, "sha512-ZW6U1YdTGR+zYV/JmnaeUCDuGkb1d0WxzoI0s+fN0DcJdAVWi6UFVmE5PIU+bUTsXvQDtErgLyVqGE6MdT9t0w=="], + + "yaml": ["yaml@2.8.3", "", { "bin": { "yaml": "bin.mjs" } }, "sha512-AvbaCLOO2Otw/lW5bmh9d/WEdcDFdQp2Z2ZUH3pX9U2ihyUY0nvLv7J6TrWowklRGPYbB/IuIMfYgxaCPg5Bpg=="], + } +} diff --git a/codemode/workerd/config.capnp b/codemode/workerd/config.capnp new file mode 100644 index 0000000..92034db --- /dev/null +++ b/codemode/workerd/config.capnp @@ -0,0 +1,38 @@ +using Workerd = import "/workerd/workerd.capnp"; + +const config :Workerd.Config = ( + services = [ + (name = "dispatcher", worker = .dispatcher), + (name = "api-proxy", worker = .apiProxy), + (name = "internet", network = (allow = ["public", "private"])), + ], + sockets = [ + (name = "http", address = "127.0.0.1:8787", http = (), service = "dispatcher"), + ], +); + +const dispatcher :Workerd.Worker = ( + modules = [ + (name = "dispatcher.js", esModule = embed "dispatcher.js"), + (name = "spec-loader.js", esModule = embed "dist/spec-loader.bundled.js"), + (name = "host.js", esModule = embed "host.js"), + (name = "api-sdk-builder.js", esModule = embed "api-sdk-builder.js"), + ], + bindings = [ + (name = "API", service = "api-proxy"), + (name = "LOADER", workerLoader = (id = "main")), + ], + compatibilityDate = "2024-09-09", + compatibilityFlags = ["nodejs_compat"], +); + +const apiProxy :Workerd.Worker = ( + modules = [ + (name = "api-proxy.js", esModule = embed "api-proxy.js"), + ], + bindings = [ + (name = "BACKEND_URL", fromEnvironment = "BACKEND_URL"), + ], + globalOutbound = "internet", + compatibilityDate = "2024-09-09", +); diff --git a/codemode/workerd/dispatcher.js b/codemode/workerd/dispatcher.js new file mode 100644 index 0000000..32833e0 --- /dev/null +++ b/codemode/workerd/dispatcher.js @@ -0,0 +1,384 @@ +import { loadSpec } from "./spec-loader.js"; +import { buildHostModule, wrapMainModule } from "./host.js"; +import { buildSdkModule } from "./api-sdk-builder.js"; + +let specState = { status: "uninitialized", error: null, data: null }; +let specPromise = null; + +async function ensureSpec(env) { + if (specState.status === "ready") return specState.data; + if (!specPromise) { + specPromise = (async () => { + try { + const data = await loadSpec(env.API); + specState = { status: "ready", error: null, data }; + return data; + } catch (e) { + specState = { status: "failed", error: String(e), data: null }; + specPromise = null; + throw e; + } + })(); + } + return specPromise; +} + +const SEARCH_TIMEOUT_MS = 5_000; +const SYNC_WINDOW_MS = 90_000; +const WALL_CAP_MS = 600_000; +const JOB_TTL_MS = 30 * 60_000; +const RESULT_CAP_BYTES = 64 * 1024; + +// DoS guards. Bound the number of in-flight isolates and the size of the +// jobStore so a flood of long-running executes (or of stuck CPU-bound code +// that workerd cannot synchronously terminate) cannot exhaust memory or +// pin every worker. /run returns 429 when a limit is hit. +const MAX_RUNNING_JOBS = 50; // concurrent execute jobs +const MAX_JOB_STORE_TOTAL = 500; // running + finished-but-not-yet-evicted +const MAX_RUNNING_SEARCHES = 50; // concurrent search isolates + +const jobStore = new Map(); +let runningSearches = 0; + +function nowMs() { return Date.now(); } + +function evictOldJobs() { + const t = nowMs(); + for (const [id, j] of jobStore.entries()) { + if (j.finishedAt && t - j.finishedAt > JOB_TTL_MS) jobStore.delete(id); + } +} + +function countRunningJobs() { + let n = 0; + for (const j of jobStore.values()) if (j.status === "running") n++; + return n; +} + +// Evict the oldest finished job to make room. Returns true if anything was +// evicted; false if every job is currently running (caller should 429). +function evictOldestFinished() { + let oldestId = null; + let oldestFinished = Infinity; + for (const [id, j] of jobStore.entries()) { + if (j.finishedAt && j.finishedAt < oldestFinished) { + oldestFinished = j.finishedAt; + oldestId = id; + } + } + if (oldestId !== null) { + jobStore.delete(oldestId); + return true; + } + return false; +} + +function notifyWaiters(job) { + for (const w of job.waiters) w(); + job.waiters.clear(); +} + +function maybeTruncateResult(result) { + try { + const s = JSON.stringify(result); + if (s.length > RESULT_CAP_BYTES) { + return { __truncated: true, preview: s.slice(0, RESULT_CAP_BYTES) }; + } + return result; + } catch (e) { + return { __unserialisable: String(e) }; + } +} + +function makeApiCallback(apiBinding, authCtx) { + return async function apiCall({ method, path, query, headers, body }) { + const r = await apiBinding.fetch("https://internal/proxy", { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ + mode: "authenticated", + method, path, query, headers, body, authCtx, + }), + }); + if (!r.ok) { + const text = await r.text(); + const err = new Error(`api-proxy ${r.status}: ${text}`); + err.name = "ProxyError"; + throw err; + } + return r.json(); + }; +} + +// Attempt best-effort isolate teardown on wall-timeout. workerd does not +// expose a synchronous isolate.terminate() API, so the V8 isolate continues +// to run user code until the Worker Loader's LRU evicts it. Disposing the +// entry stub releases the RPC connection so subsequent api-proxy calls from +// the runaway code surface as ProxyError instead of being silently delivered. +function bestEffortDispose(stub) { + try { + if (stub && typeof stub[Symbol.dispose] === "function") stub[Symbol.dispose](); + } catch { /* noop */ } +} + +async function startIsolateRun(env, { mode, code, authCtx, timeoutMs }) { + const specData = await ensureSpec(env); + const isolateId = `iso-${crypto.randomUUID()}`; + + const sdkSrc = buildSdkModule(specData.spec); + const hostSrc = buildHostModule({ specRef: specData.spec }); + const mainSrc = wrapMainModule(code); + + const worker = env.LOADER.get(isolateId, () => ({ + compatibilityDate: "2024-09-09", + mainModule: "main.js", + modules: { "main.js": mainSrc, "host.js": hostSrc, "api-sdk.js": sdkSrc }, + })); + + const entry = worker.getEntrypoint(); + const cb = mode === "execute" ? makeApiCallback(env.API, authCtx) : null; + + const cap = typeof timeoutMs === "number" ? timeoutMs : WALL_CAP_MS; + let timerHandle; + const timer = new Promise((_, rej) => { + timerHandle = setTimeout( + () => rej(new Error(mode === "search" ? "search_timeout" : "wall_timeout")), + cap, + ); + }); + + try { + return await Promise.race([entry.run(cb), timer]); + } catch (e) { + // SyntaxError thrown by the dynamic ESM compile (because userCode + // failed to parse) is reclassified as a userCode error so the model + // sees actionable feedback rather than an opaque infra failure. + if (e && (e.name === "SyntaxError" || /SyntaxError/.test(String(e?.message ?? "")))) { + return { + ok: false, + error: String(e?.message ?? e), + kind: "SyntaxError", + stack: e?.stack ?? null, + logs: [], + }; + } + throw e; + } finally { + clearTimeout(timerHandle); + // Always dispose entry+worker. On success this releases the cached + // worker promptly so /run does not accumulate isolates faster than + // the Worker Loader's LRU can evict them. On timeout this also + // severs the api-proxy callback so runaway code's further calls + // surface as ProxyError instead of being silently delivered. + bestEffortDispose(entry); + bestEffortDispose(worker); + } +} + +function newJob() { + return { + status: "running", + result: null, + error: null, + errorKind: null, + stack: null, + logs: [], + createdAt: nowMs(), + finishedAt: null, + waiters: new Set(), + }; +} + +function finaliseJob(job, isolateOutcome) { + if (isolateOutcome.kind === "done") { + job.status = "done"; + job.result = maybeTruncateResult(isolateOutcome.result); + job.logs = isolateOutcome.logs ?? []; + } else if (isolateOutcome.kind === "userError") { + job.status = "error"; + job.errorKind = "userCode"; + job.error = isolateOutcome.error; + job.stack = isolateOutcome.stack; + job.logs = isolateOutcome.logs ?? []; + } else if (isolateOutcome.kind === "wallTimeout") { + job.status = "error"; + job.errorKind = "timeout"; + job.error = "wall timeout (600s)"; + } else { + job.status = "error"; + job.errorKind = "infra"; + job.error = isolateOutcome.error ?? "unknown"; + } + job.finishedAt = nowMs(); + notifyWaiters(job); +} + +function jobResponse(jobId, job) { + if (job.status === "running") { + return { status: "running", jobId, logsSoFar: job.logs.slice(-50) }; + } + if (job.status === "done") { + return { status: "done", result: job.result, logs: job.logs }; + } + return { + status: "error", + errorKind: job.errorKind, + error: job.error, + stack: job.stack, + logs: job.logs, + }; +} + +async function awaitJobUntil(jobId, deadlineMs) { + const job = jobStore.get(jobId); + if (!job) return null; + if (job.status !== "running") return job; + return new Promise((resolve) => { + let to; + const cleanup = () => { job.waiters.delete(wake); clearTimeout(to); }; + const wake = () => { cleanup(); resolve(job); }; + job.waiters.add(wake); + const remaining = Math.max(0, deadlineMs - nowMs()); + to = setTimeout(() => { cleanup(); resolve(job); }, remaining); + }); +} + +export default { + async fetch(req, env, ctx) { + evictOldJobs(); + const url = new URL(req.url); + + if (url.pathname === "/health") { + try { + const data = await ensureSpec(env); + return Response.json({ + ok: true, + specVersion: data.version, + endpointCount: data.endpointCount, + loadedAt: data.loadedAt, + jobsRunning: [...jobStore.values()].filter((j) => j.status === "running").length, + jobStoreSize: jobStore.size, + }); + } catch (e) { + return Response.json({ ok: false, error: String(e) }, { status: 503 }); + } + } + + if (url.pathname === "/run" && req.method === "POST") { + let body; + try { body = await req.json(); } + catch { return Response.json({ status: "error", error: "invalid json" }, { status: 400 }); } + const { mode, code, authCtx } = body; + if (mode !== "search" && mode !== "execute") { + return Response.json({ status: "error", error: "mode must be search or execute" }, { status: 400 }); + } + if (typeof code !== "string" || code.length === 0) { + return Response.json({ status: "error", error: "code required" }, { status: 400 }); + } + if (code.length > 1024 * 1024) { + return Response.json({ status: "error", error: "code exceeds 1MB" }, { status: 413 }); + } + + // Search: simple sync timeout (5s). Timeout disposes the isolate. + if (mode === "search") { + if (runningSearches >= MAX_RUNNING_SEARCHES) { + return Response.json( + { status: "error", errorKind: "capacity", error: "code mode at search capacity" }, + { status: 429 }, + ); + } + runningSearches++; + try { + const out = await startIsolateRun(env, { mode, code, authCtx, timeoutMs: SEARCH_TIMEOUT_MS }); + if (out.ok) { + return Response.json({ + status: "done", + result: maybeTruncateResult(out.result), + logs: out.logs, + }); + } + return Response.json({ + status: "error", + errorKind: "userCode", + error: out.error, + stack: out.stack, + logs: out.logs, + }); + } catch (e) { + const msg = String(e?.message ?? e); + return Response.json({ + status: "error", + errorKind: msg.includes("timeout") ? "timeout" : "infra", + error: msg, + }); + } finally { + runningSearches--; + } + } + + // Execute: enforce concurrency + total caps before registering a job. + // Running cap is hard. Total cap evicts the oldest finished job + // (LRU on finishedAt) before falling back to 429 โ€” this prevents a + // burst of fast successful executes from filling the store and + // 429-ing subsequent requests for the next 30 min. + const runningJobs = countRunningJobs(); + if (runningJobs >= MAX_RUNNING_JOBS) { + return Response.json( + { status: "error", errorKind: "capacity", error: "too many running jobs" }, + { status: 429 }, + ); + } + if (jobStore.size >= MAX_JOB_STORE_TOTAL) { + if (!evictOldestFinished()) { + return Response.json( + { status: "error", errorKind: "capacity", error: "job store full (all running)" }, + { status: 429 }, + ); + } + } + + const jobId = `j_${crypto.randomUUID()}`; + const job = newJob(); + jobStore.set(jobId, job); + + const runPromise = (async () => { + try { + const out = await startIsolateRun(env, { mode, code, authCtx, timeoutMs: WALL_CAP_MS }); + if (out.ok) finaliseJob(job, { kind: "done", result: out.result, logs: out.logs }); + else finaliseJob(job, { kind: "userError", error: out.error, stack: out.stack, logs: out.logs }); + } catch (e) { + if (String(e?.message) === "wall_timeout") { + finaliseJob(job, { kind: "wallTimeout" }); + } else { + finaliseJob(job, { kind: "infra", error: String(e?.message ?? e) }); + } + } + })(); + + if (ctx?.waitUntil) ctx.waitUntil(runPromise); + + const deadline = nowMs() + SYNC_WINDOW_MS; + const finished = await awaitJobUntil(jobId, deadline); + return Response.json(jobResponse(jobId, finished ?? job)); + } + + if (url.pathname === "/poll" && req.method === "POST") { + let body; + try { body = await req.json(); } + catch { return Response.json({ status: "error", error: "invalid json" }, { status: 400 }); } + const jobId = body.jobId; + if (!jobId || typeof jobId !== "string") { + return Response.json({ status: "error", errorKind: "userCode", error: "jobId required" }, { status: 400 }); + } + const job = jobStore.get(jobId); + if (!job) { + return Response.json({ status: "error", errorKind: "jobMissing", error: "unknown jobId" }); + } + const deadline = nowMs() + SYNC_WINDOW_MS; + const finished = await awaitJobUntil(jobId, deadline); + return Response.json(jobResponse(jobId, finished ?? job)); + } + + return new Response("not found", { status: 404 }); + }, +}; diff --git a/codemode/workerd/host.js b/codemode/workerd/host.js new file mode 100644 index 0000000..6fb747d --- /dev/null +++ b/codemode/workerd/host.js @@ -0,0 +1,63 @@ +// Builds the source for a per-call `host.js` ESM module. +// Exports spec/console/sleep. `api` is constructed in main.js from the +// callback installed via setApi() RPC. +export function buildHostModule({ specRef }) { + const parts = []; + parts.push(`const spec = JSON.parse(${JSON.stringify(JSON.stringify(specRef))});`); + parts.push(`const __logs = [];`); + parts.push(`function __push(level, args) { + if (__logs.length > 1000) return; + let msg = args.map((a) => { + try { return typeof a === "string" ? a : JSON.stringify(a); } + catch { return String(a); } + }).join(" "); + if (msg.length > 4000) msg = msg.slice(0, 4000) + "โ€ฆ"; + __logs.push({ level, msg, t: Date.now() }); + }`); + parts.push(`const console = { + log: (...a) => __push("log", a), + info: (...a) => __push("info", a), + warn: (...a) => __push("warn", a), + error: (...a) => __push("error", a), + };`); + parts.push(`async function sleep(ms) { + if (typeof ms !== "number" || ms < 0) throw new Error("sleep: ms must be non-negative"); + if (ms > 60000) ms = 60000; + return new Promise((r) => setTimeout(r, ms)); + }`); + parts.push(`export { spec, console, sleep };`); + parts.push(`export function __getLogs() { return __logs; }`); + return parts.join("\n"); +} + +export function wrapMainModule(userCode) { + // userCode is interpolated into the module body. Note: a syntax error in + // userCode causes the dynamic ESM module compile to fail BEFORE run() is + // ever called, so it surfaces from the dispatcher as kind=infra (the + // worker loader factory throws). Only runtime errors thrown from inside + // userFn are caught by the try below and returned as kind=userCode. + // The dispatcher distinguishes them by inspecting the error name + // ("SyntaxError" โ†’ reclassify to userCode) before responding. + return ` +import { spec, console, sleep, __getLogs } from "host.js"; +import { buildApi } from "api-sdk.js"; +export default { + async run(callback) { + const api = callback ? buildApi(callback) : undefined; + try { + const userFn = (${userCode}); + const result = await userFn(); + return { ok: true, result, logs: __getLogs() }; + } catch (e) { + return { + ok: false, + error: String(e?.message ?? e), + kind: e?.name ?? "Error", + stack: e?.stack ?? null, + logs: __getLogs(), + }; + } + }, +}; +`; +} diff --git a/codemode/workerd/package.json b/codemode/workerd/package.json new file mode 100644 index 0000000..da57c40 --- /dev/null +++ b/codemode/workerd/package.json @@ -0,0 +1,17 @@ +{ + "name": "createos-mcp-codemode", + "private": true, + "type": "module", + "scripts": { + "build": "bun build spec-loader.js --target=browser --format=esm --outfile=dist/spec-loader.bundled.js", + "dev": "bun run build && workerd serve --experimental config.capnp", + "test": "bun test", + "resolve-spec": "bun scripts/resolve-spec.ts", + "gen-sdk": "bun scripts/gen-sdk.ts" + }, + "devDependencies": { + "workerd": "^1.20240909.0", + "yaml": "^2.5.0", + "@types/bun": "latest" + } +} diff --git a/codemode/workerd/spec-loader.js b/codemode/workerd/spec-loader.js new file mode 100644 index 0000000..925983e --- /dev/null +++ b/codemode/workerd/spec-loader.js @@ -0,0 +1,64 @@ +import YAML from "yaml"; + +function resolveRefs(obj, root = obj, seen = new Set()) { + if (obj == null || typeof obj !== "object") return obj; + if (Array.isArray(obj)) return obj.map((x) => resolveRefs(x, root, seen)); + if (typeof obj.$ref === "string") { + if (seen.has(obj.$ref)) return { __circularRef: obj.$ref }; + seen.add(obj.$ref); + const path = obj.$ref.replace(/^#\//, "").split("/"); + let target = root; + for (const seg of path) target = target?.[seg]; + const resolved = resolveRefs(target, root, seen); + seen.delete(obj.$ref); + return resolved; + } + const out = {}; + for (const [k, v] of Object.entries(obj)) out[k] = resolveRefs(v, root, seen); + return out; +} + +function strip(obj) { + if (obj == null || typeof obj !== "object") return obj; + if (Array.isArray(obj)) return obj.map(strip); + const out = {}; + for (const [k, v] of Object.entries(obj)) { + if (k === "description" || k === "example" || k === "examples") continue; + out[k] = strip(v); + } + return out; +} + +export async function loadSpec(apiBinding) { + const r = await apiBinding.fetch("https://internal/proxy", { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ + mode: "bootstrap", + method: "GET", + path: "/api-docs/openapi.yaml", + }), + }); + if (!r.ok) throw new Error(`spec bootstrap http ${r.status}`); + const wrapped = await r.json(); + if (wrapped.status !== 200) { + throw new Error(`backend returned ${wrapped.status} for openapi.yaml`); + } + const parsed = YAML.parse(wrapped.body); + const resolved = resolveRefs(parsed); + const trimmed = strip(resolved); + + let endpointCount = 0; + for (const methods of Object.values(trimmed.paths ?? {})) { + for (const k of Object.keys(methods)) { + if (k !== "parameters") endpointCount++; + } + } + + return { + spec: trimmed, + version: trimmed.info?.version ?? "unknown", + endpointCount, + loadedAt: Date.now(), + }; +} diff --git a/codemode/workerd/test/api-proxy.test.js b/codemode/workerd/test/api-proxy.test.js new file mode 100644 index 0000000..93e2801 --- /dev/null +++ b/codemode/workerd/test/api-proxy.test.js @@ -0,0 +1,348 @@ +import { describe, expect, test, mock } from "bun:test"; +import apiProxy from "../api-proxy.js"; + +const env = { BACKEND_URL: "https://backend.test" }; + +function call(payload) { + return apiProxy.fetch( + new Request("https://internal/proxy", { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify(payload), + }), + env, + ); +} + +describe("api-proxy", () => { + test("rejects unknown mode", async () => { + const r = await call({ mode: "weird", method: "GET", path: "/x" }); + expect(r.status).toBe(400); + }); + + test("authenticated mode injects X-Api-Key", async () => { + let captured; + globalThis.fetch = mock(async (url, init) => { + captured = { url, init }; + return new Response(JSON.stringify({ items: [] }), { + status: 200, + headers: { "content-type": "application/json" }, + }); + }); + const r = await call({ + mode: "authenticated", + method: "GET", + path: "/v1/projects", + authCtx: { apiKey: "k1" }, + }); + expect(r.status).toBe(200); + const body = await r.json(); + expect(body.status).toBe(200); + expect(captured.init.headers["X-Api-Key"]).toBe("k1"); + }); + + test("authenticated mode injects X-Access-Token (matches native)", async () => { + let captured; + globalThis.fetch = mock(async (url, init) => { + captured = { url, init }; + return new Response("[]", { + status: 200, + headers: { "content-type": "application/json" }, + }); + }); + await call({ + mode: "authenticated", + method: "GET", + path: "/v1/projects", + authCtx: { bearer: "tok" }, + }); + expect(captured.init.headers["X-Access-Token"]).toBe("tok"); + expect(captured.init.headers["Authorization"]).toBeUndefined(); + }); + + test("BACKEND_URL with path prefix is preserved", async () => { + let captured; + globalThis.fetch = mock(async (url, init) => { + captured = { url, init }; + return new Response("[]", { status: 200, headers: { "content-type": "application/json" } }); + }); + const r = await apiProxy.fetch( + new Request("https://internal/proxy", { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ + mode: "authenticated", + method: "GET", + path: "/v1/projects", + authCtx: { apiKey: "k" }, + }), + }), + { BACKEND_URL: "https://backend.test/api" }, + ); + expect(captured.url).toBe("https://backend.test/api/v1/projects"); + expect(r.status).toBe(200); + }); + + test("bootstrap honours BACKEND_URL path prefix", async () => { + let captured; + globalThis.fetch = mock(async (url) => { + captured = url; + return new Response("openapi: 3.0", { status: 200 }); + }); + await apiProxy.fetch( + new Request("https://internal/proxy", { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ mode: "bootstrap", method: "GET", path: "/api-docs/openapi.yaml" }), + }), + { BACKEND_URL: "https://backend.test/api" }, + ); + expect(captured).toBe("https://backend.test/api/api-docs/openapi.yaml"); + }); + + test("rejects absolute URL in path (SSRF guard)", async () => { + let called = false; + globalThis.fetch = mock(async () => { called = true; return new Response("nope"); }); + const r = await call({ + mode: "authenticated", + method: "GET", + path: "https://attacker.example/x", + authCtx: { apiKey: "secret" }, + }); + expect(r.status).toBe(400); + expect(called).toBe(false); + }); + + test("rejects dot-segment escape ('/../admin')", async () => { + let called = false; + globalThis.fetch = mock(async () => { called = true; return new Response("nope"); }); + const r = await apiProxy.fetch( + new Request("https://internal/proxy", { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ + mode: "authenticated", + method: "GET", + path: "/../admin", + authCtx: { apiKey: "k" }, + }), + }), + { BACKEND_URL: "https://backend.test/api" }, + ); + expect(r.status).toBe(400); + expect(called).toBe(false); + }); + + test("rejects percent-encoded dot-segment ('/%2e%2e/admin')", async () => { + let called = false; + globalThis.fetch = mock(async () => { called = true; return new Response("nope"); }); + const r = await apiProxy.fetch( + new Request("https://internal/proxy", { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ + mode: "authenticated", + method: "GET", + path: "/%2e%2e/admin", + authCtx: { apiKey: "k" }, + }), + }), + { BACKEND_URL: "https://backend.test/api" }, + ); + expect(r.status).toBe(400); + expect(called).toBe(false); + }); + + test("rejects mixed-case encoded dot-segment ('/%2E%2e/admin')", async () => { + let called = false; + globalThis.fetch = mock(async () => { called = true; return new Response("nope"); }); + const r = await apiProxy.fetch( + new Request("https://internal/proxy", { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ + mode: "authenticated", + method: "GET", + path: "/%2E%2e/admin", + authCtx: { apiKey: "k" }, + }), + }), + { BACKEND_URL: "https://backend.test/api" }, + ); + expect(r.status).toBe(400); + expect(called).toBe(false); + }); + + test("rejects partial-encoded dot-segment ('/%2e./admin')", async () => { + let called = false; + globalThis.fetch = mock(async () => { called = true; return new Response("nope"); }); + const r = await apiProxy.fetch( + new Request("https://internal/proxy", { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ + mode: "authenticated", + method: "GET", + path: "/%2e./admin", + authCtx: { apiKey: "k" }, + }), + }), + { BACKEND_URL: "https://backend.test/api" }, + ); + expect(r.status).toBe(400); + expect(called).toBe(false); + }); + + test("rejects invalid percent-encoding ('/%ZZ/admin')", async () => { + let called = false; + globalThis.fetch = mock(async () => { called = true; return new Response("nope"); }); + const r = await apiProxy.fetch( + new Request("https://internal/proxy", { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ + mode: "authenticated", + method: "GET", + path: "/%ZZ/admin", + authCtx: { apiKey: "k" }, + }), + }), + { BACKEND_URL: "https://backend.test/api" }, + ); + expect(r.status).toBe(400); + expect(called).toBe(false); + }); + + test("rejects dot-segment in middle of path ('/v1/foo/../../admin')", async () => { + let called = false; + globalThis.fetch = mock(async () => { called = true; return new Response("nope"); }); + const r = await apiProxy.fetch( + new Request("https://internal/proxy", { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ + mode: "authenticated", + method: "GET", + path: "/v1/foo/../../admin", + authCtx: { apiKey: "k" }, + }), + }), + { BACKEND_URL: "https://backend.test/api" }, + ); + expect(r.status).toBe(400); + expect(called).toBe(false); + }); + + test("invalid JSON body with json content-type returns raw text without throwing", async () => { + globalThis.fetch = mock(async () => new Response("not json {{{", { + status: 200, + headers: { "content-type": "application/json" }, + })); + const r = await call({ mode: "authenticated", method: "GET", path: "/v1/x", authCtx: { apiKey: "k" } }); + expect(r.status).toBe(200); + const body = await r.json(); + expect(body.body).toBe("not json {{{"); + }); + + test("rejects protocol-relative // path", async () => { + let called = false; + globalThis.fetch = mock(async () => { called = true; return new Response("nope"); }); + const r = await call({ + mode: "authenticated", + method: "GET", + path: "//attacker.example/x", + authCtx: { apiKey: "secret" }, + }); + expect(r.status).toBe(400); + expect(called).toBe(false); + }); + + test("user-injected X-Access-Token / X-Api-Key are stripped (no credential smuggling)", async () => { + let captured; + globalThis.fetch = mock(async (_url, init) => { + captured = init; + return new Response("[]", { status: 200, headers: { "content-type": "application/json" } }); + }); + await call({ + mode: "authenticated", + method: "GET", + path: "/v1/projects", + authCtx: { apiKey: "real-key" }, // bearer NOT set + headers: { + "X-Access-Token": "smuggled-bearer", + "X-Api-Key": "smuggled-key", + "Authorization": "Bearer smuggled", + "Cookie": "session=stolen", + }, + }); + expect(captured.headers["X-Api-Key"]).toBe("real-key"); + expect(captured.headers["X-Access-Token"]).toBeUndefined(); + expect(captured.headers["Authorization"]).toBeUndefined(); + expect(captured.headers["Cookie"]).toBeUndefined(); + }); + + test("user headers cannot override auth", async () => { + let captured; + globalThis.fetch = mock(async (_url, init) => { + captured = init; + return new Response("[]", { status: 200, headers: { "content-type": "application/json" } }); + }); + await call({ + mode: "authenticated", + method: "GET", + path: "/v1/projects", + authCtx: { apiKey: "real-key" }, + headers: { "X-Api-Key": "spoofed", "Authorization": "Bearer spoofed", "X-Internal-Bypass": "1" }, + }); + expect(captured.headers["X-Api-Key"]).toBe("real-key"); + expect(captured.headers["Authorization"]).toBeUndefined(); + expect(captured.headers["X-Internal-Bypass"]).toBeUndefined(); + }); + + test("strips Set-Cookie + internal x-* response headers", async () => { + globalThis.fetch = mock(async () => new Response("[]", { + status: 200, + headers: { + "content-type": "application/json", + "set-cookie": "session=secret", + "x-internal-token": "leak", + "etag": "abc", + }, + })); + const r = await call({ mode: "authenticated", method: "GET", path: "/v1/projects", authCtx: { apiKey: "k" } }); + const body = await r.json(); + expect(body.headers["set-cookie"]).toBeUndefined(); + expect(body.headers["x-internal-token"]).toBeUndefined(); + expect(body.headers["etag"]).toBe("abc"); + }); + + test("invalid JSON request body returns 400", async () => { + const r = await apiProxy.fetch( + new Request("https://internal/proxy", { + method: "POST", + headers: { "content-type": "application/json" }, + body: "not json", + }), + env, + ); + expect(r.status).toBe(400); + }); + + test("query string assembled", async () => { + let captured; + globalThis.fetch = mock(async (url, init) => { + captured = { url, init }; + return new Response("[]", { + status: 200, + headers: { "content-type": "application/json" }, + }); + }); + await call({ + mode: "authenticated", + method: "GET", + path: "/v1/projects", + query: { limit: 5, tag: ["a", "b"] }, + }); + expect(captured.url).toBe("https://backend.test/v1/projects?limit=5&tag=a&tag=b"); + }); +}); diff --git a/codemode/workerd/test/api-sdk.test.js b/codemode/workerd/test/api-sdk.test.js new file mode 100644 index 0000000..53243bc --- /dev/null +++ b/codemode/workerd/test/api-sdk.test.js @@ -0,0 +1,44 @@ +import { describe, expect, test } from "bun:test"; +import { buildSdkModule } from "../api-sdk-builder.js"; + +const SPEC = { + paths: { + "/v1/projects": { + get: { + operationId: "listProjects", + tags: ["projects"], + parameters: [{ in: "query", name: "limit", required: false }], + }, + post: { + operationId: "createProject", + tags: ["projects"], + requestBody: { content: { "application/json": { schema: { type: "object" } } } }, + }, + }, + "/v1/projects/{id}": { + get: { + operationId: "getProject", + tags: ["projects"], + parameters: [{ in: "path", name: "id", required: true }], + }, + }, + }, +}; + +describe("buildSdkModule", () => { + test("generates buildApi with grouped operations", () => { + const src = buildSdkModule(SPEC); + expect(src).toContain("export function buildApi(callback)"); + expect(src).toContain('"projects"'); + expect(src).toContain('"listProjects"'); + expect(src).toContain('"createProject"'); + expect(src).toContain('"getProject"'); + expect(src).toContain("raw:"); + }); + + test("operation closure preserves path + method", () => { + const src = buildSdkModule(SPEC); + expect(src).toContain('"path":"/v1/projects/{id}"'); + expect(src).toContain('"method":"GET"'); + }); +}); diff --git a/codemode/workerd/test/dispatcher.test.js b/codemode/workerd/test/dispatcher.test.js new file mode 100644 index 0000000..5e98294 --- /dev/null +++ b/codemode/workerd/test/dispatcher.test.js @@ -0,0 +1,50 @@ +import { describe, expect, test } from "bun:test"; +import dispatcher from "../dispatcher.js"; + +const MINI_YAML = `openapi: 3.0.0 +info: + title: t + version: 1.0.0 +paths: + /v1/foo: + get: + operationId: listFoo + responses: + '200': { description: ok } +`; + +function mockEnv() { + return { + API: { + async fetch(_url, init) { + const body = JSON.parse(init.body); + if (body.mode === "bootstrap") { + return new Response( + JSON.stringify({ status: 200, headers: {}, body: MINI_YAML }), + { status: 200 }, + ); + } + return new Response(JSON.stringify({ error: "unhandled" }), { status: 400 }); + }, + }, + }; +} + +describe("dispatcher", () => { + test("/health returns ok with spec stats", async () => { + const req = new Request("http://localhost/health"); + const res = await dispatcher.fetch(req, mockEnv(), {}); + expect(res.status).toBe(200); + const body = await res.json(); + expect(body.ok).toBe(true); + expect(body.specVersion).toBe("1.0.0"); + expect(body.endpointCount).toBe(1); + }); + + test("unknown path 404", async () => { + const req = new Request("http://localhost/whatever"); + const res = await dispatcher.fetch(req, mockEnv(), {}); + expect(res.status).toBe(404); + }); + +}); diff --git a/codemode/workerd/test/fixtures/openapi-mini.yaml b/codemode/workerd/test/fixtures/openapi-mini.yaml new file mode 100644 index 0000000..edccc8e --- /dev/null +++ b/codemode/workerd/test/fixtures/openapi-mini.yaml @@ -0,0 +1,24 @@ +openapi: 3.0.0 +info: + title: test + version: 1.0.0 +paths: + /v1/foo: + get: + operationId: listFoo + tags: [foo] + description: should be stripped + responses: + '200': + $ref: '#/components/responses/Ok' +components: + responses: + Ok: + description: ok response + content: + application/json: + schema: + type: object + properties: + items: + type: array diff --git a/codemode/workerd/test/host.test.js b/codemode/workerd/test/host.test.js new file mode 100644 index 0000000..49de8fd --- /dev/null +++ b/codemode/workerd/test/host.test.js @@ -0,0 +1,22 @@ +import { describe, expect, test } from "bun:test"; +import { buildHostModule, wrapMainModule } from "../host.js"; + +describe("buildHostModule", () => { + test("exports spec, console, sleep", () => { + const src = buildHostModule({ specRef: { paths: {} } }); + expect(src).toContain("export { spec, console, sleep }"); + }); + + test("includes sleep cap", () => { + const src = buildHostModule({ specRef: {} }); + expect(src).toContain("60000"); + }); +}); + +describe("wrapMainModule", () => { + test("emits run entrypoint that builds api from callback", () => { + const src = wrapMainModule("async () => 42"); + expect(src).toContain("async run(callback)"); + expect(src).toContain("buildApi"); + }); +}); diff --git a/codemode/workerd/test/spec-loader.test.js b/codemode/workerd/test/spec-loader.test.js new file mode 100644 index 0000000..b3cb467 --- /dev/null +++ b/codemode/workerd/test/spec-loader.test.js @@ -0,0 +1,47 @@ +import { describe, expect, test } from "bun:test"; +import fs from "node:fs"; +import { loadSpec } from "../spec-loader.js"; + +function makeBinding(yamlText) { + return { + async fetch(_url, init) { + const body = JSON.parse(init.body); + if (body.mode !== "bootstrap") throw new Error("expected bootstrap"); + return new Response( + JSON.stringify({ status: 200, headers: {}, body: yamlText }), + { status: 200 }, + ); + }, + }; +} + +describe("spec-loader", () => { + test("resolves $refs and strips descriptions", async () => { + const yamlText = fs.readFileSync( + new URL("./fixtures/openapi-mini.yaml", import.meta.url), + "utf8", + ); + const result = await loadSpec(makeBinding(yamlText)); + expect(result.endpointCount).toBe(1); + expect(result.version).toBe("1.0.0"); + const op = result.spec.paths["/v1/foo"].get; + expect(op.operationId).toBe("listFoo"); + expect(op.description).toBeUndefined(); + expect(op.responses["200"].$ref).toBeUndefined(); + expect(op.responses["200"].content["application/json"].schema.type).toBe( + "object", + ); + }); + + test("non-200 backend response throws", async () => { + const binding = { + async fetch() { + return new Response( + JSON.stringify({ status: 500, headers: {}, body: "oops" }), + { status: 200 }, + ); + }, + }; + await expect(loadSpec(binding)).rejects.toThrow(/500/); + }); +}); diff --git a/go.mod b/go.mod index 33b5404..ea323fd 100644 --- a/go.mod +++ b/go.mod @@ -5,18 +5,28 @@ go 1.25.0 require ( github.com/go-resty/resty/v2 v2.17.0 github.com/mark3labs/mcp-go v0.43.2 + github.com/prometheus/client_golang v1.23.2 golang.org/x/time v0.15.0 gopkg.in/yaml.v3 v3.0.1 ) require ( github.com/bahlo/generic-list-go v0.2.0 // indirect + github.com/beorn7/perks v1.0.1 // indirect github.com/buger/jsonparser v1.1.1 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/invopop/jsonschema v0.13.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/prometheus/client_model v0.6.2 // indirect + github.com/prometheus/common v0.66.1 // indirect + github.com/prometheus/procfs v0.16.1 // indirect github.com/spf13/cast v1.7.1 // indirect github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect github.com/yosida95/uritemplate/v3 v3.0.2 // indirect + go.yaml.in/yaml/v2 v2.4.2 // indirect golang.org/x/net v0.43.0 // indirect + golang.org/x/sys v0.35.0 // indirect + google.golang.org/protobuf v1.36.8 // indirect ) diff --git a/go.sum b/go.sum index 0ccad13..f09692e 100644 --- a/go.sum +++ b/go.sum @@ -1,45 +1,72 @@ github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/go-resty/resty/v2 v2.17.0 h1:pW9DeXcaL4Rrym4EZ8v7L19zZiIlWPg5YXAcVmt+gN0= github.com/go-resty/resty/v2 v2.17.0/go.mod h1:kCKZ3wWmwJaNc7S29BRtUhJwy7iqmn+2mLtQrOyQlVA= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/invopop/jsonschema v0.13.0 h1:KvpoAJWEjR3uD9Kbm2HWJmqsEaHt8lBUpd0qHcIi21E= github.com/invopop/jsonschema v0.13.0/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= +github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mark3labs/mcp-go v0.43.2 h1:21PUSlWWiSbUPQwXIJ5WKlETixpFpq+WBpbMGDSVy/I= github.com/mark3labs/mcp-go v0.43.2/go.mod h1:YnJfOL382MIWDx1kMY+2zsRHU/q78dBg9aFb8W6Thdw= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o= +github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg= +github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= +github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= +github.com/prometheus/common v0.66.1 h1:h5E0h5/Y8niHc5DlaLlWLArTQI7tMrsfQjHV+d9ZoGs= +github.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA= +github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg= +github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc= github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw= github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4= github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI= +go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU= golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= +golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= +golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +google.golang.org/protobuf v1.36.8 h1:xHScyCOEuuwZEc6UtSOvPbAT4zRh0xcNRYekJwfqyMc= +google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/handlers/AddProjectsToApp.go b/handlers/AddProjectsToApp.go deleted file mode 100644 index 7c78b6c..0000000 --- a/handlers/AddProjectsToApp.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type AddProjectsToAppParams struct { - AppID string `json:"app_id"` - Body map[string]interface{} `json:"body"` -} - -func AddProjectsToAppHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[AddProjectsToAppParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makePostRequest(fmt.Sprintf("/v1/apps/%s/projects", params.AppID), params.Body, authInfo) -} diff --git a/handlers/AddServicesToApp.go b/handlers/AddServicesToApp.go deleted file mode 100644 index 1a3475d..0000000 --- a/handlers/AddServicesToApp.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type AddServicesToAppParams struct { - AppID string `json:"app_id"` - Body map[string]interface{} `json:"body"` -} - -func AddServicesToAppHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[AddServicesToAppParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makePostRequest(fmt.Sprintf("/v1/apps/%s/services", params.AppID), params.Body, authInfo) -} diff --git a/handlers/AssignDeploymentToProjectEnvironment.go b/handlers/AssignDeploymentToProjectEnvironment.go deleted file mode 100644 index 5c02e57..0000000 --- a/handlers/AssignDeploymentToProjectEnvironment.go +++ /dev/null @@ -1,30 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type AssignDeploymentToProjectEnvironmentParams struct { - ProjectID string `json:"project_id"` - DeploymentID string `json:"deployment_id"` - ProjectEnvID string `json:"environment_id"` - Body map[string]interface{} `json:"body"` -} - -func AssignDeploymentToProjectEnvironmentHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[AssignDeploymentToProjectEnvironmentParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makePostRequest(fmt.Sprintf("/v1/projects/%s/environments/%s/assign-deployment", params.ProjectID, params.ProjectEnvID), params.Body, authInfo) -} diff --git a/handlers/BuyProjectTemplate.go b/handlers/BuyProjectTemplate.go deleted file mode 100644 index cfb7b58..0000000 --- a/handlers/BuyProjectTemplate.go +++ /dev/null @@ -1,27 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type BuyProjectTemplateParams struct { - TemplateID string `json:"template_id"` -} - -func BuyProjectTemplateHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[BuyProjectTemplateParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makePostRequest(fmt.Sprintf("/v1/project-templates/%s/buy", params.TemplateID), nil, authInfo) -} diff --git a/handlers/CheckAPIKeyUniqueName.go b/handlers/CheckAPIKeyUniqueName.go deleted file mode 100644 index 973963f..0000000 --- a/handlers/CheckAPIKeyUniqueName.go +++ /dev/null @@ -1,26 +0,0 @@ -package handler - -import ( - "context" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type CheckAPIKeyUniqueNameParams struct { - Body map[string]interface{} `json:"body"` -} - -func CheckAPIKeyUniqueNameHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[CheckAPIKeyUniqueNameParams](args) - if err != nil { - return nil, err - } - - return makePostRequest("/v1/api-keys/available-unique-name", params.Body, authInfo) -} diff --git a/handlers/CheckProjectEnvironmentUniqueName.go b/handlers/CheckProjectEnvironmentUniqueName.go deleted file mode 100644 index 6f9d678..0000000 --- a/handlers/CheckProjectEnvironmentUniqueName.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type CheckProjectEnvironmentUniqueNameParams struct { - ProjectID string `json:"project_id"` - Body map[string]interface{} `json:"body"` -} - -func CheckProjectEnvironmentUniqueNameHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[CheckProjectEnvironmentUniqueNameParams](args) - if err != nil { - return nil, err - } - - return makePostRequest(fmt.Sprintf("/v1/projects/%s/environments/available-unique-name", params.ProjectID), params.Body, authInfo) -} diff --git a/handlers/CreateAPIKey.go b/handlers/CreateAPIKey.go deleted file mode 100644 index ac04adb..0000000 --- a/handlers/CreateAPIKey.go +++ /dev/null @@ -1,26 +0,0 @@ -package handler - -import ( - "context" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type CreateAPIKeyParams struct { - Body map[string]interface{} `json:"body"` -} - -func CreateAPIKeyHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[CreateAPIKeyParams](args) - if err != nil { - return nil, err - } - - return makePostRequest("/v1/api-keys", params.Body, authInfo) -} diff --git a/handlers/CreateApp.go b/handlers/CreateApp.go deleted file mode 100644 index 9051821..0000000 --- a/handlers/CreateApp.go +++ /dev/null @@ -1,27 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type CreateAppParams struct { - Body map[string]interface{} `json:"body"` -} - -func CreateAppHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[CreateAppParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makePostRequest("/v1/apps", params.Body, authInfo) -} diff --git a/handlers/CreateCronjob.go b/handlers/CreateCronjob.go deleted file mode 100644 index d714370..0000000 --- a/handlers/CreateCronjob.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type CreateCronjobParams struct { - ProjectID string `json:"project_id"` - Body map[string]interface{} `json:"body"` -} - -func CreateCronjobHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[CreateCronjobParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makePostRequest(fmt.Sprintf("/v1/projects/%s/cronjobs", params.ProjectID), params.Body, authInfo) -} diff --git a/handlers/CreateDeployment.go b/handlers/CreateDeployment.go deleted file mode 100644 index 3367733..0000000 --- a/handlers/CreateDeployment.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type CreateDeploymentParams struct { - ProjectID string `json:"project_id"` - Body map[string]interface{} `json:"body"` -} - -func CreateDeploymentHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[CreateDeploymentParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makePostRequest(fmt.Sprintf("/v1/projects/%s/deployments", params.ProjectID), params.Body, authInfo) -} diff --git a/handlers/CreateDomain.go b/handlers/CreateDomain.go deleted file mode 100644 index caf9ae3..0000000 --- a/handlers/CreateDomain.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type CreateDomainParams struct { - ProjectID string `json:"project_id"` - Body map[string]interface{} `json:"body"` -} - -func CreateDomainHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[CreateDomainParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makePostRequest(fmt.Sprintf("/v1/projects/%s/domains", params.ProjectID), params.Body, authInfo) -} diff --git a/handlers/CreateProjectEnvironment.go b/handlers/CreateProjectEnvironment.go deleted file mode 100644 index daf2ce5..0000000 --- a/handlers/CreateProjectEnvironment.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type CreateProjectEnvironmentParams struct { - ProjectID string `json:"project_id"` - Body map[string]interface{} `json:"body"` -} - -func CreateProjectEnvironmentHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[CreateProjectEnvironmentParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makePostRequest(fmt.Sprintf("/v1/projects/%s/environments", params.ProjectID), params.Body, authInfo) -} diff --git a/handlers/CreateProjectTemplate.go b/handlers/CreateProjectTemplate.go deleted file mode 100644 index 01952f3..0000000 --- a/handlers/CreateProjectTemplate.go +++ /dev/null @@ -1,27 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type CreateProjectTemplateParams struct { - Body map[string]interface{} `json:"body"` -} - -func CreateProjectTemplateHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[CreateProjectTemplateParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makePostRequest("/v1/project-templates", params.Body, authInfo) -} diff --git a/handlers/DeleteApp.go b/handlers/DeleteApp.go deleted file mode 100644 index 92a6f03..0000000 --- a/handlers/DeleteApp.go +++ /dev/null @@ -1,27 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type DeleteAppParams struct { - AppID string `json:"app_id"` -} - -func DeleteAppHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[DeleteAppParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makeDeleteRequest(fmt.Sprintf("/v1/apps/%s", params.AppID), authInfo) -} diff --git a/handlers/DeleteCronjob.go b/handlers/DeleteCronjob.go deleted file mode 100644 index ac0b74b..0000000 --- a/handlers/DeleteCronjob.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type DeleteCronjobParams struct { - ProjectID string `json:"project_id"` - CronjobID string `json:"cronjob_id"` -} - -func DeleteCronjobHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[DeleteCronjobParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makeDeleteRequest(fmt.Sprintf("/v1/projects/%s/cronjobs/%s", params.ProjectID, params.CronjobID), authInfo) -} diff --git a/handlers/DeleteDeployment.go b/handlers/DeleteDeployment.go deleted file mode 100644 index 286daa7..0000000 --- a/handlers/DeleteDeployment.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type DeleteDeploymentParams struct { - ProjectID string `json:"project_id"` - DeploymentID string `json:"deployment_id"` -} - -func DeleteDeploymentHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[DeleteDeploymentParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makeDeleteRequest(fmt.Sprintf("/v1/projects/%s/deployments/%s", params.ProjectID, params.DeploymentID), authInfo) -} diff --git a/handlers/DeleteDomain.go b/handlers/DeleteDomain.go deleted file mode 100644 index e6e9fd3..0000000 --- a/handlers/DeleteDomain.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type DeleteDomainParams struct { - ProjectID string `json:"project_id"` - DomainID string `json:"domain_id"` -} - -func DeleteDomainHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[DeleteDomainParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makeDeleteRequest(fmt.Sprintf("/v1/projects/%s/domains/%s", params.ProjectID, params.DomainID), authInfo) -} diff --git a/handlers/DeleteProject.go b/handlers/DeleteProject.go deleted file mode 100644 index 324a7ef..0000000 --- a/handlers/DeleteProject.go +++ /dev/null @@ -1,27 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type DeleteProjectParams struct { - ProjectID string `json:"project_id"` -} - -func DeleteProjectHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[DeleteProjectParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makeDeleteRequest(fmt.Sprintf("/v1/projects/%s", params.ProjectID), authInfo) -} diff --git a/handlers/DeleteProjectEnvironment.go b/handlers/DeleteProjectEnvironment.go deleted file mode 100644 index 58c9152..0000000 --- a/handlers/DeleteProjectEnvironment.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type DeleteProjectEnvironmentParams struct { - ProjectID string `json:"project_id"` - ProjectEnvID string `json:"environment_id"` -} - -func DeleteProjectEnvironmentHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[DeleteProjectEnvironmentParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makeDeleteRequest(fmt.Sprintf("/v1/projects/%s/environments/%s", params.ProjectID, params.ProjectEnvID), authInfo) -} diff --git a/handlers/DeleteProjectTemplate.go b/handlers/DeleteProjectTemplate.go deleted file mode 100644 index 67b9268..0000000 --- a/handlers/DeleteProjectTemplate.go +++ /dev/null @@ -1,27 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type DeleteProjectTemplateParams struct { - TemplateID string `json:"template_id"` -} - -func DeleteProjectTemplateHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[DeleteProjectTemplateParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makeDeleteRequest(fmt.Sprintf("/v1/project-templates/%s", params.TemplateID), authInfo) -} diff --git a/handlers/DeployProjectTemplateViaGithub.go b/handlers/DeployProjectTemplateViaGithub.go deleted file mode 100644 index 22967b2..0000000 --- a/handlers/DeployProjectTemplateViaGithub.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type DeployProjectTemplateViaGithubParams struct { - PurchaseID string `json:"purchase_id"` - Body map[string]interface{} `json:"body"` -} - -func DeployProjectTemplateViaGithubHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[DeployProjectTemplateViaGithubParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makePutRequest(fmt.Sprintf("/v1/project-templates/purchases/%s/deploy-via-github", params.PurchaseID), params.Body, authInfo) -} diff --git a/handlers/DownloadDeployment.go b/handlers/DownloadDeployment.go deleted file mode 100644 index 4295b6e..0000000 --- a/handlers/DownloadDeployment.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type DownloadDeploymentParams struct { - ProjectID string `json:"project_id"` - DeploymentID string `json:"deployment_id"` -} - -func DownloadDeploymentHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[DownloadDeploymentParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makeGetRequest(fmt.Sprintf("/v1/projects/%s/deployments/%s/download", params.ProjectID, params.DeploymentID), nil, authInfo) -} diff --git a/handlers/DownloadProjectTemplate.go b/handlers/DownloadProjectTemplate.go deleted file mode 100644 index 381eccf..0000000 --- a/handlers/DownloadProjectTemplate.go +++ /dev/null @@ -1,27 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type DownloadProjectTemplateParams struct { - PurchaseID string `json:"purchase_id"` -} - -func DownloadProjectTemplateHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[DownloadProjectTemplateParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makeGetRequest(fmt.Sprintf("/v1/project-templates/purchases/%s/download", params.PurchaseID), nil, authInfo) -} diff --git a/handlers/GetBuildLogs.go b/handlers/GetBuildLogs.go deleted file mode 100644 index 7a4c028..0000000 --- a/handlers/GetBuildLogs.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type GetBuildLogsParams struct { - ProjectID string `json:"project_id"` - DeploymentID string `json:"deployment_id"` -} - -func GetBuildLogsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[GetBuildLogsParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makeGetRequest(fmt.Sprintf("/v1/projects/%s/deployments/%s/build-logs", params.ProjectID, params.DeploymentID), nil, authInfo) -} diff --git a/handlers/GetCronjob.go b/handlers/GetCronjob.go deleted file mode 100644 index 1f89211..0000000 --- a/handlers/GetCronjob.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type GetCronjobParams struct { - ProjectID string `json:"project_id"` - CronjobID string `json:"cronjob_id"` -} - -func GetCronjobHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[GetCronjobParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makeGetRequest(fmt.Sprintf("/v1/projects/%s/cronjobs/%s", params.ProjectID, params.CronjobID), nil, authInfo) -} diff --git a/handlers/GetCurrentUser.go b/handlers/GetCurrentUser.go deleted file mode 100644 index 203c3eb..0000000 --- a/handlers/GetCurrentUser.go +++ /dev/null @@ -1,16 +0,0 @@ -package handler - -import ( - "context" - - "github.com/mark3labs/mcp-go/mcp" -) - -func GetCurrentUserHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, _, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - return makeGetRequest("/v1/users/me", nil, authInfo) -} diff --git a/handlers/GetDeploymentLogs.go b/handlers/GetDeploymentLogs.go deleted file mode 100644 index f3d9ce6..0000000 --- a/handlers/GetDeploymentLogs.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type GetDeploymentLogsParams struct { - ProjectID string `json:"project_id"` - DeploymentID string `json:"deployment_id"` -} - -func GetDeploymentLogsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[GetDeploymentLogsParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makeGetRequest(fmt.Sprintf("/v1/projects/%s/deployments/%s/deployment-logs", params.ProjectID, params.DeploymentID), nil, authInfo) -} diff --git a/handlers/GetGithubRepositoryContent.go b/handlers/GetGithubRepositoryContent.go deleted file mode 100644 index 58c934c..0000000 --- a/handlers/GetGithubRepositoryContent.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type GetGithubRepositoryContentParams struct { - InstallationID string `json:"installation_id"` - Body map[string]interface{} `json:"body"` -} - -func GetGithubRepositoryContentHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[GetGithubRepositoryContentParams](args) - if err != nil { - return nil, err - } - - return makePostRequest(fmt.Sprintf("/v1/app-installations/github/accounts/%s/repositories/content", params.InstallationID), params.Body, authInfo) -} diff --git a/handlers/GetProject.go b/handlers/GetProject.go deleted file mode 100644 index 7503954..0000000 --- a/handlers/GetProject.go +++ /dev/null @@ -1,45 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type GetProjectParams struct { - ProjectID string `json:"project_id"` -} - -// GetProjectHandler is the handler function for the GetProject tool. -func GetProjectHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, err := GetAuthInfo(ctx, request) - if err != nil { - return nil, err - } - - // Parse parameters - args, ok := request.Params.Arguments.(map[string]interface{}) - if !ok { - return nil, fmt.Errorf("invalid arguments type") - } - - params, err := mcputils.ParamsParser[GetProjectParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - // Make GET request - resp, err := mcputils.Get(fmt.Sprintf("/v1/projects/%s", params.ProjectID), nil, authInfo.Method, authInfo.Value) - if err != nil { - return nil, err - } - - // Return the response - return &mcp.CallToolResult{ - Content: []mcp.Content{ - mcp.NewTextContent(string(resp.Body())), - }, - }, nil -} diff --git a/handlers/GetProjectEnvironmentAnalytics.go b/handlers/GetProjectEnvironmentAnalytics.go deleted file mode 100644 index d9e6d62..0000000 --- a/handlers/GetProjectEnvironmentAnalytics.go +++ /dev/null @@ -1,39 +0,0 @@ -package handler - -import ( - "context" - "fmt" - "strconv" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type GetProjectEnvironmentAnalyticsParams struct { - ProjectID string `json:"project_id"` - EnvironmentID string `json:"environment_id"` - Start *int64 `json:"start"` - End *int64 `json:"end"` -} - -func GetProjectEnvironmentAnalyticsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[GetProjectEnvironmentAnalyticsParams](args) - if err != nil { - return nil, err - } - - queryParams := make(map[string]string) - if params.Start != nil { - queryParams["start"] = strconv.FormatInt(*params.Start, 10) - } - if params.End != nil { - queryParams["end"] = strconv.FormatInt(*params.End, 10) - } - - return makeGetRequest(fmt.Sprintf("/v1/projects/%s/environments/%s/analytics", params.ProjectID, params.EnvironmentID), queryParams, authInfo) -} diff --git a/handlers/GetProjectEnvironmentAnalyticsOverallRequests.go b/handlers/GetProjectEnvironmentAnalyticsOverallRequests.go deleted file mode 100644 index 8d7478d..0000000 --- a/handlers/GetProjectEnvironmentAnalyticsOverallRequests.go +++ /dev/null @@ -1,39 +0,0 @@ -package handler - -import ( - "context" - "fmt" - "strconv" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type GetProjectEnvironmentAnalyticsOverallRequestsParams struct { - ProjectID string `json:"project_id"` - EnvironmentID string `json:"environment_id"` - Start *int64 `json:"start"` - End *int64 `json:"end"` -} - -func GetProjectEnvironmentAnalyticsOverallRequestsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[GetProjectEnvironmentAnalyticsOverallRequestsParams](args) - if err != nil { - return nil, err - } - - queryParams := make(map[string]string) - if params.Start != nil { - queryParams["start"] = strconv.FormatInt(*params.Start, 10) - } - if params.End != nil { - queryParams["end"] = strconv.FormatInt(*params.End, 10) - } - - return makeGetRequest(fmt.Sprintf("/v1/projects/%s/environments/%s/analytics/overall-requests", params.ProjectID, params.EnvironmentID), queryParams, authInfo) -} diff --git a/handlers/GetProjectEnvironmentAnalyticsRPM.go b/handlers/GetProjectEnvironmentAnalyticsRPM.go deleted file mode 100644 index b022ccb..0000000 --- a/handlers/GetProjectEnvironmentAnalyticsRPM.go +++ /dev/null @@ -1,39 +0,0 @@ -package handler - -import ( - "context" - "fmt" - "strconv" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type GetProjectEnvironmentAnalyticsRPMParams struct { - ProjectID string `json:"project_id"` - EnvironmentID string `json:"environment_id"` - Start *int64 `json:"start"` - End *int64 `json:"end"` -} - -func GetProjectEnvironmentAnalyticsRPMHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[GetProjectEnvironmentAnalyticsRPMParams](args) - if err != nil { - return nil, err - } - - queryParams := make(map[string]string) - if params.Start != nil { - queryParams["start"] = strconv.FormatInt(*params.Start, 10) - } - if params.End != nil { - queryParams["end"] = strconv.FormatInt(*params.End, 10) - } - - return makeGetRequest(fmt.Sprintf("/v1/projects/%s/environments/%s/analytics/rpm", params.ProjectID, params.EnvironmentID), queryParams, authInfo) -} diff --git a/handlers/GetProjectEnvironmentAnalyticsRequestDistribution.go b/handlers/GetProjectEnvironmentAnalyticsRequestDistribution.go deleted file mode 100644 index 28dab1b..0000000 --- a/handlers/GetProjectEnvironmentAnalyticsRequestDistribution.go +++ /dev/null @@ -1,39 +0,0 @@ -package handler - -import ( - "context" - "fmt" - "strconv" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type GetProjectEnvironmentAnalyticsRequestDistributionParams struct { - ProjectID string `json:"project_id"` - EnvironmentID string `json:"environment_id"` - Start *int64 `json:"start"` - End *int64 `json:"end"` -} - -func GetProjectEnvironmentAnalyticsRequestDistributionHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[GetProjectEnvironmentAnalyticsRequestDistributionParams](args) - if err != nil { - return nil, err - } - - queryParams := make(map[string]string) - if params.Start != nil { - queryParams["start"] = strconv.FormatInt(*params.Start, 10) - } - if params.End != nil { - queryParams["end"] = strconv.FormatInt(*params.End, 10) - } - - return makeGetRequest(fmt.Sprintf("/v1/projects/%s/environments/%s/analytics/request-distribution", params.ProjectID, params.EnvironmentID), queryParams, authInfo) -} diff --git a/handlers/GetProjectEnvironmentAnalyticsRequestsOverTime.go b/handlers/GetProjectEnvironmentAnalyticsRequestsOverTime.go deleted file mode 100644 index 45b337c..0000000 --- a/handlers/GetProjectEnvironmentAnalyticsRequestsOverTime.go +++ /dev/null @@ -1,40 +0,0 @@ -package handler - -import ( - "context" - "fmt" - "strconv" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type GetProjectEnvironmentAnalyticsRequestsOverTimeParams struct { - ProjectID string `json:"project_id"` - EnvironmentID string `json:"environment_id"` - Start int64 `json:"start,omitempty"` - End int64 `json:"end,omitempty"` -} - -func GetProjectEnvironmentAnalyticsRequestsOverTimeHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[GetProjectEnvironmentAnalyticsRequestsOverTimeParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - queryParams := make(map[string]string) - if params.Start > 0 { - queryParams["start"] = strconv.FormatInt(params.Start, 10) - } - if params.End > 0 { - queryParams["end"] = strconv.FormatInt(params.End, 10) - } - - // GET /v1/projects/{project_id}/environments/{environment_id}/analytics/requests-over-time - return makeGetRequest(fmt.Sprintf("/v1/projects/%s/environments/%s/analytics/requests-over-time", params.ProjectID, params.EnvironmentID), queryParams, authInfo) -} diff --git a/handlers/GetProjectEnvironmentAnalyticsSuccessPercentage.go b/handlers/GetProjectEnvironmentAnalyticsSuccessPercentage.go deleted file mode 100644 index a1287b5..0000000 --- a/handlers/GetProjectEnvironmentAnalyticsSuccessPercentage.go +++ /dev/null @@ -1,39 +0,0 @@ -package handler - -import ( - "context" - "fmt" - "strconv" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type GetProjectEnvironmentAnalyticsSuccessPercentageParams struct { - ProjectID string `json:"project_id"` - EnvironmentID string `json:"environment_id"` - Start *int64 `json:"start"` - End *int64 `json:"end"` -} - -func GetProjectEnvironmentAnalyticsSuccessPercentageHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[GetProjectEnvironmentAnalyticsSuccessPercentageParams](args) - if err != nil { - return nil, err - } - - queryParams := make(map[string]string) - if params.Start != nil { - queryParams["start"] = strconv.FormatInt(*params.Start, 10) - } - if params.End != nil { - queryParams["end"] = strconv.FormatInt(*params.End, 10) - } - - return makeGetRequest(fmt.Sprintf("/v1/projects/%s/environments/%s/analytics/success-percentage", params.ProjectID, params.EnvironmentID), queryParams, authInfo) -} diff --git a/handlers/GetProjectEnvironmentAnalyticsTopErrorPaths.go b/handlers/GetProjectEnvironmentAnalyticsTopErrorPaths.go deleted file mode 100644 index 2aea7cf..0000000 --- a/handlers/GetProjectEnvironmentAnalyticsTopErrorPaths.go +++ /dev/null @@ -1,39 +0,0 @@ -package handler - -import ( - "context" - "fmt" - "strconv" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type GetProjectEnvironmentAnalyticsTopErrorPathsParams struct { - ProjectID string `json:"project_id"` - EnvironmentID string `json:"environment_id"` - Start *int64 `json:"start"` - End *int64 `json:"end"` -} - -func GetProjectEnvironmentAnalyticsTopErrorPathsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[GetProjectEnvironmentAnalyticsTopErrorPathsParams](args) - if err != nil { - return nil, err - } - - queryParams := make(map[string]string) - if params.Start != nil { - queryParams["start"] = strconv.FormatInt(*params.Start, 10) - } - if params.End != nil { - queryParams["end"] = strconv.FormatInt(*params.End, 10) - } - - return makeGetRequest(fmt.Sprintf("/v1/projects/%s/environments/%s/analytics/top-error-paths", params.ProjectID, params.EnvironmentID), queryParams, authInfo) -} diff --git a/handlers/GetProjectEnvironmentAnalyticsTopHitPaths.go b/handlers/GetProjectEnvironmentAnalyticsTopHitPaths.go deleted file mode 100644 index e9b04e7..0000000 --- a/handlers/GetProjectEnvironmentAnalyticsTopHitPaths.go +++ /dev/null @@ -1,39 +0,0 @@ -package handler - -import ( - "context" - "fmt" - "strconv" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type GetProjectEnvironmentAnalyticsTopHitPathsParams struct { - ProjectID string `json:"project_id"` - EnvironmentID string `json:"environment_id"` - Start *int64 `json:"start"` - End *int64 `json:"end"` -} - -func GetProjectEnvironmentAnalyticsTopHitPathsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[GetProjectEnvironmentAnalyticsTopHitPathsParams](args) - if err != nil { - return nil, err - } - - queryParams := make(map[string]string) - if params.Start != nil { - queryParams["start"] = strconv.FormatInt(*params.Start, 10) - } - if params.End != nil { - queryParams["end"] = strconv.FormatInt(*params.End, 10) - } - - return makeGetRequest(fmt.Sprintf("/v1/projects/%s/environments/%s/analytics/top-hit-paths", params.ProjectID, params.EnvironmentID), queryParams, authInfo) -} diff --git a/handlers/GetProjectEnvironmentLogs.go b/handlers/GetProjectEnvironmentLogs.go deleted file mode 100644 index 06560ef..0000000 --- a/handlers/GetProjectEnvironmentLogs.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type GetProjectEnvironmentLogsParams struct { - ProjectID string `json:"project_id"` - EnvironmentID string `json:"environment_id"` -} - -func GetProjectEnvironmentLogsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[GetProjectEnvironmentLogsParams](args) - if err != nil { - return nil, err - } - - return makeGetRequest(fmt.Sprintf("/v1/projects/%s/environments/%s/logs", params.ProjectID, params.EnvironmentID), nil, authInfo) -} diff --git a/handlers/GetProjectTemplate.go b/handlers/GetProjectTemplate.go deleted file mode 100644 index f987664..0000000 --- a/handlers/GetProjectTemplate.go +++ /dev/null @@ -1,27 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type GetProjectTemplateParams struct { - TemplateID string `json:"template_id"` -} - -func GetProjectTemplateHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[GetProjectTemplateParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makeGetRequest(fmt.Sprintf("/v1/project-templates/%s", params.TemplateID), nil, authInfo) -} diff --git a/handlers/GetProjectTransferUri.go b/handlers/GetProjectTransferUri.go deleted file mode 100644 index 5fffccb..0000000 --- a/handlers/GetProjectTransferUri.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type GetProjectTransferUriParams struct { - ProjectID string `json:"project_id"` -} - -func GetProjectTransferUriHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[GetProjectTransferUriParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - // GET /v1/projects/{project_id}/transfer-uri - return makeGetRequest(fmt.Sprintf("/v1/projects/%s/transfer-uri", params.ProjectID), nil, authInfo) -} diff --git a/handlers/GetSecurityScan.go b/handlers/GetSecurityScan.go deleted file mode 100644 index 63471f7..0000000 --- a/handlers/GetSecurityScan.go +++ /dev/null @@ -1,29 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type GetSecurityScanParams struct { - ProjectID string `json:"project_id"` - DeploymentID string `json:"deployment_id"` -} - -func GetSecurityScanHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[GetSecurityScanParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - // GET /v1/projects/{project_id}/deployments/{deployment_id}/security-scans - return makeGetRequest(fmt.Sprintf("/v1/projects/%s/deployments/%s/security-scans", params.ProjectID, params.DeploymentID), nil, authInfo) -} diff --git a/handlers/GetSecurityScanDownloadUri.go b/handlers/GetSecurityScanDownloadUri.go deleted file mode 100644 index 7462d80..0000000 --- a/handlers/GetSecurityScanDownloadUri.go +++ /dev/null @@ -1,29 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type GetSecurityScanDownloadUriParams struct { - ProjectID string `json:"project_id"` - DeploymentID string `json:"deployment_id"` -} - -func GetSecurityScanDownloadUriHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[GetSecurityScanDownloadUriParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - // GET /v1/projects/{project_id}/deployments/{deployment_id}/security-scans/download - return makeGetRequest(fmt.Sprintf("/v1/projects/%s/deployments/%s/security-scans/download", params.ProjectID, params.DeploymentID), nil, authInfo) -} diff --git a/handlers/InstallGithubApp.go b/handlers/InstallGithubApp.go deleted file mode 100644 index 974e417..0000000 --- a/handlers/InstallGithubApp.go +++ /dev/null @@ -1,26 +0,0 @@ -package handler - -import ( - "context" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type InstallGithubAppParams struct { - Body map[string]interface{} `json:"body"` -} - -func InstallGithubAppHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[InstallGithubAppParams](args) - if err != nil { - return nil, err - } - - return makePostRequest("/v1/app-installations/github", params.Body, authInfo) -} diff --git a/handlers/ListAPIKeys.go b/handlers/ListAPIKeys.go deleted file mode 100644 index 52289e5..0000000 --- a/handlers/ListAPIKeys.go +++ /dev/null @@ -1,17 +0,0 @@ -package handler - -import ( - "context" - - "github.com/mark3labs/mcp-go/mcp" -) - -func ListAPIKeysHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, _, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - return makeGetRequest("/v1/api-keys", nil, authInfo) -} - diff --git a/handlers/ListApps.go b/handlers/ListApps.go deleted file mode 100644 index 680327e..0000000 --- a/handlers/ListApps.go +++ /dev/null @@ -1,18 +0,0 @@ -package handler - -import ( - "context" - - "github.com/mark3labs/mcp-go/mcp" -) - -func ListAppsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, _, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - return makeGetRequest("/v1/apps", nil, authInfo) -} - - diff --git a/handlers/ListConnectedGithubAccounts.go b/handlers/ListConnectedGithubAccounts.go deleted file mode 100644 index d6847dc..0000000 --- a/handlers/ListConnectedGithubAccounts.go +++ /dev/null @@ -1,16 +0,0 @@ -package handler - -import ( - "context" - - "github.com/mark3labs/mcp-go/mcp" -) - -func ListConnectedGithubAccountsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, _, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - return makeGetRequest("/v1/app-installations/github/accounts", nil, authInfo) -} diff --git a/handlers/ListCronjobActivities.go b/handlers/ListCronjobActivities.go deleted file mode 100644 index 6920815..0000000 --- a/handlers/ListCronjobActivities.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type ListCronjobActivitiesParams struct { - ProjectID string `json:"project_id"` - CronjobID string `json:"cronjob_id"` -} - -func ListCronjobActivitiesHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[ListCronjobActivitiesParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makeGetRequest(fmt.Sprintf("/v1/projects/%s/cronjobs/%s/activities", params.ProjectID, params.CronjobID), nil, authInfo) -} diff --git a/handlers/ListCronjobs.go b/handlers/ListCronjobs.go deleted file mode 100644 index 5b552b6..0000000 --- a/handlers/ListCronjobs.go +++ /dev/null @@ -1,27 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type ListCronjobsParams struct { - ProjectID string `json:"project_id"` -} - -func ListCronjobsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[ListCronjobsParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makeGetRequest(fmt.Sprintf("/v1/projects/%s/cronjobs", params.ProjectID), nil, authInfo) -} diff --git a/handlers/ListDeployments.go b/handlers/ListDeployments.go deleted file mode 100644 index 84c1f00..0000000 --- a/handlers/ListDeployments.go +++ /dev/null @@ -1,38 +0,0 @@ -package handler - -import ( - "context" - "fmt" - "strconv" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type ListDeploymentsParams struct { - ProjectID string `json:"project_id"` - Limit *int `json:"limit"` - Offset *int `json:"offset"` -} - -func ListDeploymentsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[ListDeploymentsParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - queryParams := make(map[string]string) - if params.Limit != nil { - queryParams["limit"] = strconv.Itoa(*params.Limit) - } - if params.Offset != nil { - queryParams["offset"] = strconv.Itoa(*params.Offset) - } - - return makeGetRequest(fmt.Sprintf("/v1/projects/%s/deployments", params.ProjectID), queryParams, authInfo) -} diff --git a/handlers/ListDomains.go b/handlers/ListDomains.go deleted file mode 100644 index 202cb12..0000000 --- a/handlers/ListDomains.go +++ /dev/null @@ -1,27 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type ListDomainsParams struct { - ProjectID string `json:"project_id"` -} - -func ListDomainsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[ListDomainsParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makeGetRequest(fmt.Sprintf("/v1/projects/%s/domains", params.ProjectID), nil, authInfo) -} diff --git a/handlers/ListGithubRepositories.go b/handlers/ListGithubRepositories.go deleted file mode 100644 index ac65b30..0000000 --- a/handlers/ListGithubRepositories.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type ListGithubRepositoriesParams struct { - InstallationID string `json:"installation_id"` -} - -func ListGithubRepositoriesHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[ListGithubRepositoriesParams](args) - if err != nil { - return nil, err - } - - queryParams := map[string]string{"installation_id": params.InstallationID} - return makeGetRequest(fmt.Sprintf("/v1/app-installations/github/accounts/%s/repositories", params.InstallationID), queryParams, authInfo) -} diff --git a/handlers/ListGithubRepositoryBranches.go b/handlers/ListGithubRepositoryBranches.go deleted file mode 100644 index 3f007ff..0000000 --- a/handlers/ListGithubRepositoryBranches.go +++ /dev/null @@ -1,31 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type ListGithubRepositoryBranchesParams struct { - InstallationID string `json:"installation_id"` - Repository string `json:"repository"` -} - -func ListGithubRepositoryBranchesHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[ListGithubRepositoryBranchesParams](args) - if err != nil { - return nil, err - } - - queryParams := map[string]string{ - "repository": params.Repository, - } - return makeGetRequest(fmt.Sprintf("/v1/app-installations/github/accounts/%s/repositories/branches", params.InstallationID), queryParams, authInfo) -} diff --git a/handlers/ListMyProjectTemplates.go b/handlers/ListMyProjectTemplates.go deleted file mode 100644 index 83b0430..0000000 --- a/handlers/ListMyProjectTemplates.go +++ /dev/null @@ -1,37 +0,0 @@ -package handler - -import ( - "context" - "fmt" - "strconv" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type ListMyProjectTemplatesParams struct { - Limit *int `json:"limit"` - Offset *int `json:"offset"` -} - -func ListMyProjectTemplatesHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[ListMyProjectTemplatesParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - queryParams := make(map[string]string) - if params.Limit != nil { - queryParams["limit"] = strconv.Itoa(*params.Limit) - } - if params.Offset != nil { - queryParams["offset"] = strconv.Itoa(*params.Offset) - } - - return makeGetRequest("/v1/project-templates/my", queryParams, authInfo) -} diff --git a/handlers/ListProjectEnvironments.go b/handlers/ListProjectEnvironments.go deleted file mode 100644 index 26b9f24..0000000 --- a/handlers/ListProjectEnvironments.go +++ /dev/null @@ -1,27 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type ListProjectEnvironmentsParams struct { - ProjectID string `json:"project_id"` -} - -func ListProjectEnvironmentsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[ListProjectEnvironmentsParams](args) - if err != nil { - return nil, err - } - - return makeGetRequest(fmt.Sprintf("/v1/projects/%s/environments", params.ProjectID), nil, authInfo) -} diff --git a/handlers/ListProjectTemplateCounts.go b/handlers/ListProjectTemplateCounts.go deleted file mode 100644 index ca44bdc..0000000 --- a/handlers/ListProjectTemplateCounts.go +++ /dev/null @@ -1,32 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type ListProjectTemplateCountsParams struct { - Name *string `json:"name"` -} - -func ListProjectTemplateCountsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[ListProjectTemplateCountsParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - queryParams := make(map[string]string) - if params.Name != nil { - queryParams["name"] = *params.Name - } - - return makeGetRequest("/v1/project-templates/counts", queryParams, authInfo) -} diff --git a/handlers/ListProjectTemplatePurchases.go b/handlers/ListProjectTemplatePurchases.go deleted file mode 100644 index f9330a8..0000000 --- a/handlers/ListProjectTemplatePurchases.go +++ /dev/null @@ -1,37 +0,0 @@ -package handler - -import ( - "context" - "fmt" - "strconv" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type ListProjectTemplatePurchasesParams struct { - Limit *int `json:"limit"` - Offset *int `json:"offset"` -} - -func ListProjectTemplatePurchasesHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[ListProjectTemplatePurchasesParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - queryParams := make(map[string]string) - if params.Limit != nil { - queryParams["limit"] = strconv.Itoa(*params.Limit) - } - if params.Offset != nil { - queryParams["offset"] = strconv.Itoa(*params.Offset) - } - - return makeGetRequest("/v1/project-templates/purchases", queryParams, authInfo) -} diff --git a/handlers/ListProjectTemplateRejections.go b/handlers/ListProjectTemplateRejections.go deleted file mode 100644 index d978ef5..0000000 --- a/handlers/ListProjectTemplateRejections.go +++ /dev/null @@ -1,27 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type ListProjectTemplateRejectionsParams struct { - TemplateID string `json:"template_id"` -} - -func ListProjectTemplateRejectionsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[ListProjectTemplateRejectionsParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makeGetRequest(fmt.Sprintf("/v1/project-templates/%s/rejections", params.TemplateID), nil, authInfo) -} diff --git a/handlers/ListProjectTransferHistory.go b/handlers/ListProjectTransferHistory.go deleted file mode 100644 index 20a8c41..0000000 --- a/handlers/ListProjectTransferHistory.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type ListProjectTransferHistoryParams struct { - ProjectID string `json:"project_id"` -} - -func ListProjectTransferHistoryHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[ListProjectTransferHistoryParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - // GET /v1/projects/{project_id}/transfer-history - return makeGetRequest(fmt.Sprintf("/v1/projects/%s/transfer-history", params.ProjectID), nil, authInfo) -} diff --git a/handlers/ListProjects.go b/handlers/ListProjects.go deleted file mode 100644 index 9d414a8..0000000 --- a/handlers/ListProjects.go +++ /dev/null @@ -1,72 +0,0 @@ -package handler - -import ( - "context" - "fmt" - "strconv" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type ListProjectsParams struct { - Limit *int `json:"limit"` - Offset *int `json:"offset"` - Status *string `json:"status"` - App *string `json:"app"` - Name *string `json:"name"` - Type *string `json:"type"` -} - -// ListProjectsHandler is the handler function for the ListProjects tool. -func ListProjectsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, err := GetAuthInfo(ctx, request) - if err != nil { - return nil, err - } - - // Parse parameters - args, ok := request.Params.Arguments.(map[string]interface{}) - if !ok { - return nil, fmt.Errorf("invalid arguments type") - } - - params, err := mcputils.ParamsParser[ListProjectsParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - // Build query parameters - queryParams := make(map[string]string) - if params.Limit != nil { - queryParams["limit"] = strconv.Itoa(*params.Limit) - } - if params.Offset != nil { - queryParams["offset"] = strconv.Itoa(*params.Offset) - } - if params.Status != nil { - queryParams["status"] = *params.Status - } - if params.App != nil { - queryParams["app"] = *params.App - } - if params.Name != nil { - queryParams["name"] = *params.Name - } - if params.Type != nil { - queryParams["type"] = *params.Type - } - - // Make GET request using Resty - resp, err := mcputils.Get("/v1/projects", queryParams, authInfo.Method, authInfo.Value) - if err != nil { - return nil, err - } - - // Return the response - return &mcp.CallToolResult{ - Content: []mcp.Content{ - mcp.NewTextContent(string(resp.Body())), - }, - }, nil -} diff --git a/handlers/ListProjectsByApp.go b/handlers/ListProjectsByApp.go deleted file mode 100644 index d23b34a..0000000 --- a/handlers/ListProjectsByApp.go +++ /dev/null @@ -1,39 +0,0 @@ -package handler - -import ( - "context" - "fmt" - "strconv" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type ListProjectsByAppParams struct { - AppID string `json:"app_id"` - Limit int `json:"limit,omitempty"` - Offset int `json:"offset,omitempty"` -} - -func ListProjectsByAppHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[ListProjectsByAppParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - queryParams := make(map[string]string) - if params.Limit > 0 { - queryParams["limit"] = strconv.Itoa(params.Limit) - } - if params.Offset > 0 { - queryParams["offset"] = strconv.Itoa(params.Offset) - } - - // GET /v1/apps/{app_id}/projects - return makeGetRequest(fmt.Sprintf("/v1/apps/%s/projects", params.AppID), queryParams, authInfo) -} diff --git a/handlers/ListPublishedProjectTemplates.go b/handlers/ListPublishedProjectTemplates.go deleted file mode 100644 index 1c8606e..0000000 --- a/handlers/ListPublishedProjectTemplates.go +++ /dev/null @@ -1,45 +0,0 @@ -package handler - -import ( - "context" - "fmt" - "strconv" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type ListPublishedProjectTemplatesParams struct { - Limit *int `json:"limit"` - Offset *int `json:"offset"` - Categories *string `json:"categories"` - Name *string `json:"name"` -} - -func ListPublishedProjectTemplatesHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[ListPublishedProjectTemplatesParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - queryParams := make(map[string]string) - if params.Limit != nil { - queryParams["limit"] = strconv.Itoa(*params.Limit) - } - if params.Offset != nil { - queryParams["offset"] = strconv.Itoa(*params.Offset) - } - if params.Categories != nil { - queryParams["categories"] = *params.Categories - } - if params.Name != nil { - queryParams["name"] = *params.Name - } - - return makeGetRequest("/v1/project-templates", queryParams, authInfo) -} diff --git a/handlers/ListServicesByApp.go b/handlers/ListServicesByApp.go deleted file mode 100644 index d4c4b63..0000000 --- a/handlers/ListServicesByApp.go +++ /dev/null @@ -1,39 +0,0 @@ -package handler - -import ( - "context" - "fmt" - "strconv" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type ListServicesByAppParams struct { - AppID string `json:"app_id"` - Limit int `json:"limit,omitempty"` - Offset int `json:"offset,omitempty"` -} - -func ListServicesByAppHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[ListServicesByAppParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - queryParams := make(map[string]string) - if params.Limit > 0 { - queryParams["limit"] = strconv.Itoa(params.Limit) - } - if params.Offset > 0 { - queryParams["offset"] = strconv.Itoa(params.Offset) - } - - // GET /v1/apps/{app_id}/services - return makeGetRequest(fmt.Sprintf("/v1/apps/%s/services", params.AppID), queryParams, authInfo) -} diff --git a/handlers/RefreshDomain.go b/handlers/RefreshDomain.go deleted file mode 100644 index 3e7fccc..0000000 --- a/handlers/RefreshDomain.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type RefreshDomainParams struct { - ProjectID string `json:"project_id"` - DomainID string `json:"domain_id"` -} - -func RefreshDomainHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[RefreshDomainParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makePostRequest(fmt.Sprintf("/v1/projects/%s/domains/%s/refresh", params.ProjectID, params.DomainID), nil, authInfo) -} diff --git a/handlers/RemoveProjectsFromApp.go b/handlers/RemoveProjectsFromApp.go deleted file mode 100644 index d6d9866..0000000 --- a/handlers/RemoveProjectsFromApp.go +++ /dev/null @@ -1,29 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type RemoveProjectsFromAppParams struct { - AppID string `json:"app_id"` - Body map[string]interface{} `json:"body"` -} - -func RemoveProjectsFromAppHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[RemoveProjectsFromAppParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - // POST /v1/apps/{app_id}/projects/remove - return makePostRequest(fmt.Sprintf("/v1/apps/%s/projects/remove", params.AppID), params.Body, authInfo) -} diff --git a/handlers/RemoveServicesFromApp.go b/handlers/RemoveServicesFromApp.go deleted file mode 100644 index 7ab9ac8..0000000 --- a/handlers/RemoveServicesFromApp.go +++ /dev/null @@ -1,29 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type RemoveServicesFromAppParams struct { - AppID string `json:"app_id"` - Body map[string]interface{} `json:"body"` -} - -func RemoveServicesFromAppHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[RemoveServicesFromAppParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - // POST /v1/apps/{app_id}/services/remove - return makePostRequest(fmt.Sprintf("/v1/apps/%s/services/remove", params.AppID), params.Body, authInfo) -} diff --git a/handlers/RetriggerDeployment.go b/handlers/RetriggerDeployment.go deleted file mode 100644 index 6860725..0000000 --- a/handlers/RetriggerDeployment.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type RetriggerDeploymentParams struct { - ProjectID string `json:"project_id"` - DeploymentID string `json:"deployment_id"` -} - -func RetriggerDeploymentHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[RetriggerDeploymentParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makePostRequest(fmt.Sprintf("/v1/projects/%s/deployments/%s/retrigger", params.ProjectID, params.DeploymentID), nil, authInfo) -} diff --git a/handlers/RetriggerSecurityScan.go b/handlers/RetriggerSecurityScan.go deleted file mode 100644 index db4944a..0000000 --- a/handlers/RetriggerSecurityScan.go +++ /dev/null @@ -1,29 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type RetriggerSecurityScanParams struct { - ProjectID string `json:"project_id"` - DeploymentID string `json:"deployment_id"` -} - -func RetriggerSecurityScanHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[RetriggerSecurityScanParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - // POST /v1/projects/{project_id}/deployments/{deployment_id}/security-scans/retrigger - return makePostRequest(fmt.Sprintf("/v1/projects/%s/deployments/%s/security-scans/retrigger", params.ProjectID, params.DeploymentID), nil, authInfo) -} diff --git a/handlers/RevokeAPIKey.go b/handlers/RevokeAPIKey.go deleted file mode 100644 index 5b558f5..0000000 --- a/handlers/RevokeAPIKey.go +++ /dev/null @@ -1,27 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type RevokeAPIKeyParams struct { - APIKeyID string `json:"api_key_id"` -} - -func RevokeAPIKeyHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[RevokeAPIKeyParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makeDeleteRequest(fmt.Sprintf("/v1/api-keys/%s", params.APIKeyID), authInfo) -} diff --git a/handlers/SuspendCronjob.go b/handlers/SuspendCronjob.go deleted file mode 100644 index 8897dec..0000000 --- a/handlers/SuspendCronjob.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type SuspendCronjobParams struct { - ProjectID string `json:"project_id"` - CronjobID string `json:"cronjob_id"` -} - -func SuspendCronjobHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[SuspendCronjobParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makePostRequest(fmt.Sprintf("/v1/projects/%s/cronjobs/%s/suspend", params.ProjectID, params.CronjobID), nil, authInfo) -} diff --git a/handlers/TransferProject.go b/handlers/TransferProject.go deleted file mode 100644 index b21ff37..0000000 --- a/handlers/TransferProject.go +++ /dev/null @@ -1,33 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type TransferProjectParams struct { - ProjectID string `json:"project_id"` - Token string `json:"token"` -} - -func TransferProjectHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[TransferProjectParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - queryParams := map[string]string{ - "token": params.Token, - } - - // GET /v1/projects/{project_id}/transfer?token={token} - return makeGetRequest(fmt.Sprintf("/v1/projects/%s/transfer", params.ProjectID), queryParams, authInfo) -} diff --git a/handlers/TriggerLatestDeployment.go b/handlers/TriggerLatestDeployment.go deleted file mode 100644 index e311de6..0000000 --- a/handlers/TriggerLatestDeployment.go +++ /dev/null @@ -1,32 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type TriggerLatestDeploymentParams struct { - ProjectID string `json:"project_id"` - Branch string `json:"branch"` -} - -func TriggerLatestDeploymentHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[TriggerLatestDeploymentParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - queryParams := map[string]string{ - "branch": params.Branch, - } - - return makePostRequest(fmt.Sprintf("/v1/projects/%s/trigger-latest", params.ProjectID), queryParams, authInfo) -} diff --git a/handlers/TriggerSecurityScan.go b/handlers/TriggerSecurityScan.go deleted file mode 100644 index 060d0b1..0000000 --- a/handlers/TriggerSecurityScan.go +++ /dev/null @@ -1,29 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type TriggerSecurityScanParams struct { - ProjectID string `json:"project_id"` - DeploymentID string `json:"deployment_id"` -} - -func TriggerSecurityScanHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[TriggerSecurityScanParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - // POST /v1/projects/{project_id}/deployments/{deployment_id}/security-scans/trigger - return makePostRequest(fmt.Sprintf("/v1/projects/%s/deployments/%s/security-scans/trigger", params.ProjectID, params.DeploymentID), nil, authInfo) -} diff --git a/handlers/UnsuspendCronjob.go b/handlers/UnsuspendCronjob.go deleted file mode 100644 index bed98c3..0000000 --- a/handlers/UnsuspendCronjob.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type UnsuspendCronjobParams struct { - ProjectID string `json:"project_id"` - CronjobID string `json:"cronjob_id"` -} - -func UnsuspendCronjobHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[UnsuspendCronjobParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makePostRequest(fmt.Sprintf("/v1/projects/%s/cronjobs/%s/unsuspend", params.ProjectID, params.CronjobID), nil, authInfo) -} diff --git a/handlers/UpdateAPIKey.go b/handlers/UpdateAPIKey.go deleted file mode 100644 index 94dee3e..0000000 --- a/handlers/UpdateAPIKey.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type UpdateAPIKeyParams struct { - APIKeyID string `json:"api_key_id"` - Body map[string]interface{} `json:"body"` -} - -func UpdateAPIKeyHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[UpdateAPIKeyParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makePutRequest(fmt.Sprintf("/v1/api-keys/%s", params.APIKeyID), params.Body, authInfo) -} diff --git a/handlers/UpdateApp.go b/handlers/UpdateApp.go deleted file mode 100644 index c08962a..0000000 --- a/handlers/UpdateApp.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type UpdateAppParams struct { - AppID string `json:"app_id"` - Body map[string]interface{} `json:"body"` -} - -func UpdateAppHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[UpdateAppParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makePatchRequest(fmt.Sprintf("/v1/apps/%s", params.AppID), params.Body, authInfo) -} diff --git a/handlers/UpdateCronjob.go b/handlers/UpdateCronjob.go deleted file mode 100644 index 709fd2c..0000000 --- a/handlers/UpdateCronjob.go +++ /dev/null @@ -1,29 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type UpdateCronjobParams struct { - ProjectID string `json:"project_id"` - CronjobID string `json:"cronjob_id"` - Body map[string]interface{} `json:"body"` -} - -func UpdateCronjobHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[UpdateCronjobParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makePutRequest(fmt.Sprintf("/v1/projects/%s/cronjobs/%s", params.ProjectID, params.CronjobID), params.Body, authInfo) -} diff --git a/handlers/UpdateDomainEnvironment.go b/handlers/UpdateDomainEnvironment.go deleted file mode 100644 index a76ae94..0000000 --- a/handlers/UpdateDomainEnvironment.go +++ /dev/null @@ -1,30 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type UpdateDomainEnvironmentParams struct { - ProjectID string `json:"project_id"` - DomainID string `json:"domain_id"` - Body map[string]interface{} `json:"body"` -} - -func UpdateDomainEnvironmentHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[UpdateDomainEnvironmentParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - // PUT /v1/projects/{project_id}/domains/{domain_id}/environment - return makePutRequest(fmt.Sprintf("/v1/projects/%s/domains/%s/environment", params.ProjectID, params.DomainID), params.Body, authInfo) -} diff --git a/handlers/UpdateProject.go b/handlers/UpdateProject.go deleted file mode 100644 index 58a3a9e..0000000 --- a/handlers/UpdateProject.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type UpdateProjectParams struct { - ProjectID string `json:"project_id"` - Body map[string]interface{} `json:"body"` -} - -func UpdateProjectHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[UpdateProjectParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makePutRequest(fmt.Sprintf("/v1/projects/%s", params.ProjectID), params.Body, authInfo) -} diff --git a/handlers/UpdateProjectEnvironment.go b/handlers/UpdateProjectEnvironment.go deleted file mode 100644 index 6f79551..0000000 --- a/handlers/UpdateProjectEnvironment.go +++ /dev/null @@ -1,29 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type UpdateProjectEnvironmentParams struct { - ProjectID string `json:"project_id"` - ProjectEnvID string `json:"environment_id"` - Body map[string]interface{} `json:"body"` -} - -func UpdateProjectEnvironmentHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[UpdateProjectEnvironmentParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makePutRequest(fmt.Sprintf("/v1/projects/%s/environments/%s", params.ProjectID, params.ProjectEnvID), params.Body, authInfo) -} diff --git a/handlers/UpdateProjectEnvironmentEnvironmentVariables.go b/handlers/UpdateProjectEnvironmentEnvironmentVariables.go deleted file mode 100644 index e858bbb..0000000 --- a/handlers/UpdateProjectEnvironmentEnvironmentVariables.go +++ /dev/null @@ -1,29 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type UpdateProjectEnvironmentEnvironmentVariablesParams struct { - ProjectID string `json:"project_id"` - ProjectEnvID string `json:"environment_id"` - Body map[string]interface{} `json:"body"` -} - -func UpdateProjectEnvironmentEnvironmentVariablesHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[UpdateProjectEnvironmentEnvironmentVariablesParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makePutRequest(fmt.Sprintf("/v1/projects/%s/environments/%s/environment-variables", params.ProjectID, params.ProjectEnvID), params.Body, authInfo) -} diff --git a/handlers/UpdateProjectEnvironmentResources.go b/handlers/UpdateProjectEnvironmentResources.go deleted file mode 100644 index c610c3d..0000000 --- a/handlers/UpdateProjectEnvironmentResources.go +++ /dev/null @@ -1,29 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type UpdateProjectEnvironmentResourcesParams struct { - ProjectID string `json:"project_id"` - ProjectEnvID string `json:"environment_id"` - Body map[string]interface{} `json:"body"` -} - -func UpdateProjectEnvironmentResourcesHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[UpdateProjectEnvironmentResourcesParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makePutRequest(fmt.Sprintf("/v1/projects/%s/environments/%s/resources", params.ProjectID, params.ProjectEnvID), params.Body, authInfo) -} diff --git a/handlers/UpdateProjectSettings.go b/handlers/UpdateProjectSettings.go deleted file mode 100644 index 1a8446b..0000000 --- a/handlers/UpdateProjectSettings.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type UpdateProjectSettingsParams struct { - ProjectID string `json:"project_id"` - Body map[string]interface{} `json:"body"` -} - -func UpdateProjectSettingsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[UpdateProjectSettingsParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makePutRequest(fmt.Sprintf("/v1/projects/%s/settings", params.ProjectID), params.Body, authInfo) -} diff --git a/handlers/UpdateProjectTemplate.go b/handlers/UpdateProjectTemplate.go deleted file mode 100644 index daa67e7..0000000 --- a/handlers/UpdateProjectTemplate.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type UpdateProjectTemplateParams struct { - TemplateID string `json:"template_id"` - Body map[string]interface{} `json:"body"` -} - -func UpdateProjectTemplateHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[UpdateProjectTemplateParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makePutRequest(fmt.Sprintf("/v1/project-templates/%s", params.TemplateID), params.Body, authInfo) -} diff --git a/handlers/UpdateProjectTemplateStatus.go b/handlers/UpdateProjectTemplateStatus.go deleted file mode 100644 index ed60b61..0000000 --- a/handlers/UpdateProjectTemplateStatus.go +++ /dev/null @@ -1,27 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type UpdateProjectTemplateStatusParams struct { - TemplateID string `json:"template_id"` -} - -func UpdateProjectTemplateStatusHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[UpdateProjectTemplateStatusParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makePutRequest(fmt.Sprintf("/v1/project-templates/%s/send-for-review", params.TemplateID), nil, authInfo) -} diff --git a/handlers/UploadDeploymentFiles.go b/handlers/UploadDeploymentFiles.go deleted file mode 100644 index ddee4a5..0000000 --- a/handlers/UploadDeploymentFiles.go +++ /dev/null @@ -1,29 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type UploadDeploymentFilesParams struct { - ProjectID string `json:"project_id"` - Body map[string]interface{} `json:"body"` -} - -func UploadDeploymentFilesHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[UploadDeploymentFilesParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - // PUT /v1/projects/{project_id}/deployments/files - return makePutRequest(fmt.Sprintf("/v1/projects/%s/deployments/files", params.ProjectID), params.Body, authInfo) -} diff --git a/handlers/UploadDeploymentZip.go b/handlers/UploadDeploymentZip.go deleted file mode 100644 index f646633..0000000 --- a/handlers/UploadDeploymentZip.go +++ /dev/null @@ -1,29 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type UploadDeploymentZipParams struct { - ProjectID string `json:"project_id"` - Body map[string]interface{} `json:"body"` -} - -func UploadDeploymentZipHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[UploadDeploymentZipParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - // PUT /v1/projects/{project_id}/deployments/upload-zip - return makePutRequest(fmt.Sprintf("/v1/projects/%s/deployments/upload-zip", params.ProjectID), params.Body, authInfo) -} diff --git a/handlers/WakeupDeployment.go b/handlers/WakeupDeployment.go deleted file mode 100644 index 8262fb9..0000000 --- a/handlers/WakeupDeployment.go +++ /dev/null @@ -1,28 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - mcputils "github.com/NodeOps-app/createos-mcp/helpers" - "github.com/mark3labs/mcp-go/mcp" -) - -type WakeupDeploymentParams struct { - ProjectID string `json:"project_id"` - DeploymentID string `json:"deployment_id"` -} - -func WakeupDeploymentHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - authInfo, args, err := handleRequest(ctx, request) - if err != nil { - return nil, err - } - - params, err := mcputils.ParamsParser[WakeupDeploymentParams](args) - if err != nil { - return nil, fmt.Errorf("failed to parse parameters: %w", err) - } - - return makePostRequest(fmt.Sprintf("/v1/projects/%s/deployments/%s/wakeup", params.ProjectID, params.DeploymentID), nil, authInfo) -} diff --git a/k8s/pod-v2.yaml b/k8s/pod-v2.yaml new file mode 100644 index 0000000..e3c8796 --- /dev/null +++ b/k8s/pod-v2.yaml @@ -0,0 +1,79 @@ +apiVersion: v1 +kind: Pod +metadata: + name: createos-mcp + labels: + app: createos-mcp + version: v2 +spec: + securityContext: + runAsNonRoot: true + seccompProfile: + type: RuntimeDefault + volumes: + - name: mcp-config + configMap: + name: createos-mcp-config + # ConfigMap must contain a key named "config.yaml" with the + # rendered MCP config (BaseURL, Port, Transport, etc). + items: + - key: config.yaml + path: config.yaml + containers: + - name: mcp + image: createos-mcp:v2.0.0 + imagePullPolicy: IfNotPresent + env: + - name: WORKERD_URL + value: http://127.0.0.1:8787 + - name: CREATEOS_MCP_CONFIG + value: /etc/createos/config.yaml + volumeMounts: + - name: mcp-config + mountPath: /etc/createos + readOnly: true + ports: + - name: metrics + containerPort: 9090 + - name: mcp + containerPort: 8080 + readinessProbe: + httpGet: + path: /readyz + port: mcp + initialDelaySeconds: 5 + periodSeconds: 5 + securityContext: + readOnlyRootFilesystem: true + allowPrivilegeEscalation: false + capabilities: + drop: ["ALL"] + - name: workerd + image: createos-mcp-workerd:v2.0.0 + imagePullPolicy: IfNotPresent + env: + - name: BACKEND_URL + valueFrom: + secretKeyRef: + name: createos-mcp + key: BACKEND_URL + ports: + - name: workerd + containerPort: 8787 + readinessProbe: + httpGet: + path: /health + port: workerd + initialDelaySeconds: 3 + periodSeconds: 5 + livenessProbe: + httpGet: + path: /health + port: workerd + initialDelaySeconds: 30 + periodSeconds: 30 + securityContext: + readOnlyRootFilesystem: true + allowPrivilegeEscalation: false + capabilities: + drop: ["ALL"] diff --git a/main.go b/main.go index 78848ce..f70a8d5 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,7 @@ package main import ( + "context" "encoding/json" "flag" "fmt" @@ -8,18 +9,25 @@ import ( "log" "net" "net/http" + "os" "strings" "sync" "time" + "github.com/NodeOps-app/createos-mcp/codemode" "github.com/NodeOps-app/createos-mcp/config" "github.com/NodeOps-app/createos-mcp/pkg/oauth" "github.com/mark3labs/mcp-go/server" + "github.com/prometheus/client_golang/prometheus/promhttp" "golang.org/x/time/rate" ) func main() { - configPath := flag.String("config", "config.yaml", "Path to the config file") + defaultConfig := os.Getenv("CREATEOS_MCP_CONFIG") + if defaultConfig == "" { + defaultConfig = "config.yaml" + } + configPath := flag.String("config", defaultConfig, "Path to the config file (env: CREATEOS_MCP_CONFIG)") flag.Parse() if configPath == nil { @@ -32,6 +40,14 @@ func main() { mcpServer := NewMCPServer() + // Code Mode: workerd sidecar health probe. + wd := os.Getenv("WORKERD_URL") + if wd == "" { + wd = "http://127.0.0.1:8787" + } + cmMonitor := codemode.NewHealthMonitor(codemode.NewClient(wd)) + cmMonitor.Start(context.Background(), 5*time.Second) + switch config.Cfg.Transport { case "stdio": if err := server.ServeStdio(mcpServer); err != nil { @@ -51,8 +67,25 @@ func main() { mcpHandler = corsMiddleware(mcpHandler) mcpHandler = authMiddleware(*config.Cfg, mcpHandler) + // Inject incoming HTTP request headers into the request context so + // codemode.AuthFromRequest's stdio fallback (AuthFromContext) finds + // them. AuthFromRequest's primary path reads mcp.CallToolRequest.Header + // directly; this is belt-and-braces for transports where the MCP + // library does not surface headers on the request struct. + mcpHandler = codemodeAuthHeadersMiddleware(mcpHandler) mux.Handle("/mcp", mcpHandler) + mux.HandleFunc("/readyz", func(w http.ResponseWriter, r *http.Request) { + if cmMonitor.Ready() { + w.WriteHeader(http.StatusOK) + _, _ = w.Write([]byte(`{"ok":true}`)) + return + } + w.WriteHeader(http.StatusServiceUnavailable) + _, _ = w.Write([]byte(`{"ok":false,"reason":"workerd sidecar not ready"}`)) + }) + mux.Handle("/metrics", promhttp.Handler()) + // Wrap the entire mux with logging middleware to log ALL requests rootHandler := loggingMiddleware(mux) @@ -152,20 +185,43 @@ func loggingMiddleware(next http.Handler) http.Handler { }) } +func codemodeAuthHeadersMiddleware(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + headers := map[string]string{} + if v := r.Header.Get("X-Api-Key"); v != "" { + headers["X-Api-Key"] = v + } + if v := r.Header.Get("Authorization"); v != "" { + headers["Authorization"] = v + } + if len(headers) > 0 { + r = r.WithContext(codemode.WithAuthHeaders(r.Context(), headers)) + } + next.ServeHTTP(w, r) + }) +} + func authMiddleware(cfg config.Config, next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { apiKey := r.Header.Get("X-Api-Key") - bearerToken := r.Header.Get("Authorization") - if bearerToken != "" { - parts := strings.Split(bearerToken, " ") - if len(parts) < 2 || parts[1] == "" { + authHeader := r.Header.Get("Authorization") + var bearerToken string + if authHeader != "" { + // Only "Bearer " is accepted. Anything else (e.g. + // "Basic abc", a missing scheme, or empty token) is rejected + // before falling through to the missing-credentials check โ€” + // otherwise a stray Authorization header would silently + // satisfy the auth gate. + parts := strings.SplitN(authHeader, " ", 2) + if len(parts) != 2 || !strings.EqualFold(parts[0], "Bearer") || parts[1] == "" { w.WriteHeader(http.StatusUnauthorized) return } + bearerToken = parts[1] } - // either api key or bearer token is required - // If both are missing, send 401 with WWW-Authenticate header pointing to PRM endpoint + // Either an API key or a Bearer token is required. + // If both are missing, send 401 with WWW-Authenticate header pointing to PRM endpoint. if apiKey == "" && bearerToken == "" { prmURL := fmt.Sprintf("%s/.well-known/oauth-protected-resource", cfg.BaseURL) w.Header().Set("WWW-Authenticate", fmt.Sprintf(`Bearer realm="createos", resource_metadata="%s"`, prmURL)) diff --git a/mcptools/AddProjectsToApp.go b/mcptools/AddProjectsToApp.go deleted file mode 100644 index a62c1ac..0000000 --- a/mcptools/AddProjectsToApp.go +++ /dev/null @@ -1,202 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the AddProjectsToApp tool -const addProjectsToAppInputSchema = `{ - "properties": { - "app_id": { - "description": "App unique identifier", - "format": "uuid", - "type": "string" - }, - "body": { - "properties": { - "projectIds": { - "description": "List of project IDs to add to or remove from the app", - "example": [ - "550e8400-e29b-41d4-a716-446655440000", - "550e8400-e29b-41d4-a716-446655440001" - ], - "items": { - "format": "uuid", - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "projectIds" - ], - "type": "object" - } - }, - "required": [ - "app_id", - "body" - ], - "type": "object" -}` - -// Response Template for the AddProjectsToApp tool (Status: 200, Content-Type: application/json) -const AddProjectsToAppResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Projects added to app successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'projects added to app successfully' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the AddProjectsToApp tool (Status: 400, Content-Type: application/json) -const AddProjectsToAppResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the AddProjectsToApp tool (Status: 401, Content-Type: application/json) -const AddProjectsToAppResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the AddProjectsToApp tool (Status: 403, Content-Type: application/json) -const AddProjectsToAppResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the AddProjectsToApp tool (Status: 404, Content-Type: application/json) -const AddProjectsToAppResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the AddProjectsToApp tool (Status: 500, Content-Type: application/json) -const AddProjectsToAppResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewAddProjectsToAppMCPTool creates the MCP Tool instance for AddProjectsToApp -func NewAddProjectsToAppMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "AddProjectsToApp", - "Add projects to app - Associates one or more projects with an app", - []byte(addProjectsToAppInputSchema), - ) -} - -// AddProjectsToAppHandler is the handler function for the AddProjectsToApp tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func AddProjectsToAppHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "AddProjectsToApp") -} diff --git a/mcptools/AddServicesToApp.go b/mcptools/AddServicesToApp.go deleted file mode 100644 index 1d53680..0000000 --- a/mcptools/AddServicesToApp.go +++ /dev/null @@ -1,202 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the AddServicesToApp tool -const addServicesToAppInputSchema = `{ - "properties": { - "app_id": { - "description": "App unique identifier", - "format": "uuid", - "type": "string" - }, - "body": { - "properties": { - "serviceIds": { - "description": "List of service IDs to add to or remove from the app", - "example": [ - "550e8400-e29b-41d4-a716-446655440000", - "550e8400-e29b-41d4-a716-446655440001" - ], - "items": { - "format": "uuid", - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "serviceIds" - ], - "type": "object" - } - }, - "required": [ - "app_id", - "body" - ], - "type": "object" -}` - -// Response Template for the AddServicesToApp tool (Status: 200, Content-Type: application/json) -const AddServicesToAppResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Services added to app successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'services added to app successfully' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the AddServicesToApp tool (Status: 400, Content-Type: application/json) -const AddServicesToAppResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the AddServicesToApp tool (Status: 401, Content-Type: application/json) -const AddServicesToAppResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the AddServicesToApp tool (Status: 403, Content-Type: application/json) -const AddServicesToAppResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the AddServicesToApp tool (Status: 404, Content-Type: application/json) -const AddServicesToAppResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the AddServicesToApp tool (Status: 500, Content-Type: application/json) -const AddServicesToAppResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewAddServicesToAppMCPTool creates the MCP Tool instance for AddServicesToApp -func NewAddServicesToAppMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "AddServicesToApp", - "Add services to app - Associates one or more services with an app", - []byte(addServicesToAppInputSchema), - ) -} - -// AddServicesToAppHandler is the handler function for the AddServicesToApp tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func AddServicesToAppHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "AddServicesToApp") -} diff --git a/mcptools/AssignDeploymentToProjectEnvironment.go b/mcptools/AssignDeploymentToProjectEnvironment.go deleted file mode 100644 index cc1180d..0000000 --- a/mcptools/AssignDeploymentToProjectEnvironment.go +++ /dev/null @@ -1,223 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the AssignDeploymentToProjectEnvironment tool -const assignDeploymentToProjectEnvironmentInputSchema = `{ - "properties": { - "body": { - "properties": { - "deploymentId": { - "example": "550e8400-e29b-41d4-a716-446655440000", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "deploymentId" - ], - "type": "object" - }, - "environment_id": { - "description": "Environment unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "environment_id", - "body" - ], - "type": "object" -}` - -// Response Template for the AssignDeploymentToProjectEnvironment tool (Status: 200, Content-Type: application/json) -const AssignDeploymentToProjectEnvironmentResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Deployment assigned successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'deployment assigned to project environment successfully' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the AssignDeploymentToProjectEnvironment tool (Status: 400, Content-Type: application/json) -const AssignDeploymentToProjectEnvironmentResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the AssignDeploymentToProjectEnvironment tool (Status: 401, Content-Type: application/json) -const AssignDeploymentToProjectEnvironmentResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the AssignDeploymentToProjectEnvironment tool (Status: 403, Content-Type: application/json) -const AssignDeploymentToProjectEnvironmentResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the AssignDeploymentToProjectEnvironment tool (Status: 404, Content-Type: application/json) -const AssignDeploymentToProjectEnvironmentResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the AssignDeploymentToProjectEnvironment tool (Status: 422, Content-Type: application/json) -const AssignDeploymentToProjectEnvironmentResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Unprocessable Entity - deployment not eligible or project not active - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the AssignDeploymentToProjectEnvironment tool (Status: 500, Content-Type: application/json) -const AssignDeploymentToProjectEnvironmentResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewAssignDeploymentToProjectEnvironmentMCPTool creates the MCP Tool instance for AssignDeploymentToProjectEnvironment -func NewAssignDeploymentToProjectEnvironmentMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "AssignDeploymentToProjectEnvironment", - "Assign deployment to environment - Assigns a deployment to a project environment", - []byte(assignDeploymentToProjectEnvironmentInputSchema), - ) -} - -// AssignDeploymentToProjectEnvironmentHandler is the handler function for the AssignDeploymentToProjectEnvironment tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func AssignDeploymentToProjectEnvironmentHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "AssignDeploymentToProjectEnvironment") -} diff --git a/mcptools/BuyProjectTemplate.go b/mcptools/BuyProjectTemplate.go deleted file mode 100644 index f70e3f8..0000000 --- a/mcptools/BuyProjectTemplate.go +++ /dev/null @@ -1,180 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the BuyProjectTemplate tool -const buyProjectTemplateInputSchema = `{ - "properties": { - "template_id": { - "format": "uuid", - "type": "string" - } - }, - "required": [ - "template_id" - ], - "type": "object" -}` - -// Response Template for the BuyProjectTemplate tool (Status: 200, Content-Type: application/json) -const BuyProjectTemplateResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Purchase created; returns purchase ID - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **id**: Created resource ID (e.g. purchase ID) (Type: string, uuid): - - **status** (Type: string): - - Example: 'success' -` - -// Response Template for the BuyProjectTemplate tool (Status: 400, Content-Type: application/json) -const BuyProjectTemplateResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the BuyProjectTemplate tool (Status: 401, Content-Type: application/json) -const BuyProjectTemplateResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the BuyProjectTemplate tool (Status: 404, Content-Type: application/json) -const BuyProjectTemplateResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Template not found or deleted - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the BuyProjectTemplate tool (Status: 422, Content-Type: application/json) -const BuyProjectTemplateResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Already purchased or insufficient credit - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the BuyProjectTemplate tool (Status: 500, Content-Type: application/json) -const BuyProjectTemplateResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewBuyProjectTemplateMCPTool creates the MCP Tool instance for BuyProjectTemplate -func NewBuyProjectTemplateMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "BuyProjectTemplate", - "Buy project template - Purchases the template using the user's credits. Deducts template amount from user balance and creates a purchase record. User must not have already purchased this template.", - []byte(buyProjectTemplateInputSchema), - ) -} - -// BuyProjectTemplateHandler is the handler function for the BuyProjectTemplate tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func BuyProjectTemplateHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "BuyProjectTemplate") -} diff --git a/mcptools/CheckAPIKeyUniqueName.go b/mcptools/CheckAPIKeyUniqueName.go deleted file mode 100644 index 704cf96..0000000 --- a/mcptools/CheckAPIKeyUniqueName.go +++ /dev/null @@ -1,149 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the CheckAPIKeyUniqueName tool -const checkAPIKeyUniqueNameInputSchema = `{ - "properties": { - "body": { - "properties": { - "uniqueName": { - "description": "API key name to check for availability", - "example": "my-api-key", - "maxLength": 48, - "minLength": 4, - "pattern": "^[a-zA-Z0-9-]+$", - "type": "string" - } - }, - "required": [ - "uniqueName" - ], - "type": "object" - } - }, - "required": [ - "body" - ], - "type": "object" -}` - -// Response Template for the CheckAPIKeyUniqueName tool (Status: 200, Content-Type: application/json) -const CheckAPIKeyUniqueNameResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Availability check completed - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **isAvailable** (Type: boolean): - - Example: 'true' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the CheckAPIKeyUniqueName tool (Status: 400, Content-Type: application/json) -const CheckAPIKeyUniqueNameResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CheckAPIKeyUniqueName tool (Status: 401, Content-Type: application/json) -const CheckAPIKeyUniqueNameResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CheckAPIKeyUniqueName tool (Status: 500, Content-Type: application/json) -const CheckAPIKeyUniqueNameResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewCheckAPIKeyUniqueNameMCPTool creates the MCP Tool instance for CheckAPIKeyUniqueName -func NewCheckAPIKeyUniqueNameMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "CheckAPIKeyUniqueName", - "Check if API key name is available - Checks if an API key name is available for the authenticated user", - []byte(checkAPIKeyUniqueNameInputSchema), - ) -} - -// CheckAPIKeyUniqueNameHandler is the handler function for the CheckAPIKeyUniqueName tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func CheckAPIKeyUniqueNameHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "CheckAPIKeyUniqueName") -} diff --git a/mcptools/CheckProjectEnvironmentUniqueName.go b/mcptools/CheckProjectEnvironmentUniqueName.go deleted file mode 100644 index a504596..0000000 --- a/mcptools/CheckProjectEnvironmentUniqueName.go +++ /dev/null @@ -1,154 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the CheckProjectEnvironmentUniqueName tool -const checkProjectEnvironmentUniqueNameInputSchema = `{ - "properties": { - "body": { - "properties": { - "uniqueName": { - "example": "production", - "maxLength": 32, - "minLength": 4, - "pattern": "^[a-zA-Z0-9-]+$", - "type": "string" - } - }, - "required": [ - "uniqueName" - ], - "type": "object" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "body" - ], - "type": "object" -}` - -// Response Template for the CheckProjectEnvironmentUniqueName tool (Status: 200, Content-Type: application/json) -const CheckProjectEnvironmentUniqueNameResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Availability check completed - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **isAvailable** (Type: boolean): - - Example: 'true' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the CheckProjectEnvironmentUniqueName tool (Status: 400, Content-Type: application/json) -const CheckProjectEnvironmentUniqueNameResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CheckProjectEnvironmentUniqueName tool (Status: 401, Content-Type: application/json) -const CheckProjectEnvironmentUniqueNameResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CheckProjectEnvironmentUniqueName tool (Status: 500, Content-Type: application/json) -const CheckProjectEnvironmentUniqueNameResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewCheckProjectEnvironmentUniqueNameMCPTool creates the MCP Tool instance for CheckProjectEnvironmentUniqueName -func NewCheckProjectEnvironmentUniqueNameMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "CheckProjectEnvironmentUniqueName", - "Check if environment unique name is available - Checks if an environment unique name is available for a project", - []byte(checkProjectEnvironmentUniqueNameInputSchema), - ) -} - -// CheckProjectEnvironmentUniqueNameHandler is the handler function for the CheckProjectEnvironmentUniqueName tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func CheckProjectEnvironmentUniqueNameHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "CheckProjectEnvironmentUniqueName") -} diff --git a/mcptools/CreateAPIKey.go b/mcptools/CreateAPIKey.go deleted file mode 100644 index 502f97f..0000000 --- a/mcptools/CreateAPIKey.go +++ /dev/null @@ -1,166 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the CreateAPIKey tool -const createAPIKeyInputSchema = `{ - "properties": { - "body": { - "properties": { - "description": { - "example": "API key for production use", - "maxLength": 2048, - "minLength": 4, - "pattern": "^[a-zA-Z0-9 _-]+$", - "type": [ - "string", - "null" - ] - }, - "expiryAt": { - "description": "Expiration date and time (must be in the future)", - "example": "2025-12-31T23:59:59Z", - "format": "date-time", - "type": "string" - }, - "name": { - "example": "my-api-key", - "maxLength": 48, - "minLength": 4, - "pattern": "^[a-zA-Z0-9-]+$", - "type": "string" - } - }, - "required": [ - "name", - "expiryAt" - ], - "type": "object" - } - }, - "required": [ - "body" - ], - "type": "object" -}` - -// Response Template for the CreateAPIKey tool (Status: 201, Content-Type: application/json) -const CreateAPIKeyResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 201 - -**Content-Type:** application/json - -> API key created successfully - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'true' - - **data** (Type: object): - - **secret**: Full API key secret (only shown once on creation) (Type: string): - - Example: 'skp_abc123def456...' - - **id** (Type: string, uuid): -` - -// Response Template for the CreateAPIKey tool (Status: 400, Content-Type: application/json) -const CreateAPIKeyResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error or limit reached - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateAPIKey tool (Status: 401, Content-Type: application/json) -const CreateAPIKeyResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateAPIKey tool (Status: 500, Content-Type: application/json) -const CreateAPIKeyResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewCreateAPIKeyMCPTool creates the MCP Tool instance for CreateAPIKey -func NewCreateAPIKeyMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "CreateAPIKey", - "Create API key - Creates a new API key for the authenticated user", - []byte(createAPIKeyInputSchema), - ) -} - -// CreateAPIKeyHandler is the handler function for the CreateAPIKey tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func CreateAPIKeyHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "CreateAPIKey") -} diff --git a/mcptools/CreateApp.go b/mcptools/CreateApp.go deleted file mode 100644 index 359d308..0000000 --- a/mcptools/CreateApp.go +++ /dev/null @@ -1,186 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the CreateApp tool -const createAppInputSchema = `{ - "properties": { - "body": { - "properties": { - "color": { - "description": "Hex color code for the app (defaults to", - "example": "#3B82F6", - "pattern": "^#[0-9A-Fa-f]{6}$", - "type": "string" - }, - "description": { - "description": "Description of the app", - "example": "A collection of related projects and services", - "maxLength": 2048, - "minLength": 1, - "type": [ - "string", - "null" - ] - }, - "name": { - "description": "Name of the app", - "example": "My Application", - "maxLength": 255, - "minLength": 2, - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - } - }, - "required": [ - "body" - ], - "type": "object" -}` - -// Response Template for the CreateApp tool (Status: 200, Content-Type: application/json) -const CreateAppResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> App created successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **id** (Type: string, uuid): - - Example: '550e8400-e29b-41d4-a716-446655440000' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the CreateApp tool (Status: 400, Content-Type: application/json) -const CreateAppResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateApp tool (Status: 401, Content-Type: application/json) -const CreateAppResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateApp tool (Status: 429, Content-Type: application/json) -const CreateAppResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 429 - -**Content-Type:** application/json - -> Too many requests - maximum apps per user reached - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateApp tool (Status: 500, Content-Type: application/json) -const CreateAppResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewCreateAppMCPTool creates the MCP Tool instance for CreateApp -func NewCreateAppMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "CreateApp", - "Create app - Creates a new app to organize projects and services", - []byte(createAppInputSchema), - ) -} - -// CreateAppHandler is the handler function for the CreateApp tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func CreateAppHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "CreateApp") -} diff --git a/mcptools/CreateCronjob.go b/mcptools/CreateCronjob.go deleted file mode 100644 index 3b91f1e..0000000 --- a/mcptools/CreateCronjob.go +++ /dev/null @@ -1,300 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the CreateCronjob tool -const createCronjobInputSchema = `{ - "properties": { - "body": { - "properties": { - "environmentId": { - "description": "Environment to run the cronjob in", - "format": "uuid", - "type": "string" - }, - "name": { - "description": "Name of the cronjob", - "example": "health-check", - "maxLength": 255, - "minLength": 1, - "type": "string" - }, - "schedule": { - "description": "Cron schedule expression", - "example": "*/5 * * * *", - "maxLength": 256, - "type": "string" - }, - "settings": { - "description": "Cronjob type-specific settings", - "oneOf": [ - { - "properties": { - "body": { - "description": "Request body", - "maxLength": 65536, - "type": [ - "string", - "null" - ] - }, - "headers": { - "additionalProperties": { - "type": "string" - }, - "description": "HTTP headers to include in the request", - "example": { - "Authorization": "Bearer token" - }, - "type": "object" - }, - "method": { - "description": "HTTP method", - "enum": [ - "GET", - "POST", - "PUT", - "DELETE", - "PATCH", - "HEAD" - ], - "example": "GET", - "type": "string" - }, - "path": { - "description": "Request path (must start with /)", - "example": "/api/health", - "maxLength": 2048, - "type": "string" - }, - "timeoutInSeconds": { - "description": "Request timeout in seconds", - "example": 5, - "maximum": 5, - "minimum": 1, - "type": "integer" - } - }, - "required": [ - "path", - "method" - ], - "type": "object" - } - ] - }, - "type": { - "description": "Type of the cronjob", - "enum": [ - "http", - "artifact" - ], - "example": "http", - "type": "string" - } - }, - "required": [ - "name", - "schedule", - "type", - "environmentId" - ], - "type": "object" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "body" - ], - "type": "object" -}` - -// Response Template for the CreateCronjob tool (Status: 200, Content-Type: application/json) -const CreateCronjobResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Cronjob created successfully - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'true' - - **data** (Type: object): - - **id**: Created resource ID (e.g. purchase ID) (Type: string, uuid): -` - -// Response Template for the CreateCronjob tool (Status: 400, Content-Type: application/json) -const CreateCronjobResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateCronjob tool (Status: 401, Content-Type: application/json) -const CreateCronjobResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateCronjob tool (Status: 403, Content-Type: application/json) -const CreateCronjobResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateCronjob tool (Status: 404, Content-Type: application/json) -const CreateCronjobResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateCronjob tool (Status: 422, Content-Type: application/json) -const CreateCronjobResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Unprocessable Entity - cronjob limit reached or environment not active - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateCronjob tool (Status: 500, Content-Type: application/json) -const CreateCronjobResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewCreateCronjobMCPTool creates the MCP Tool instance for CreateCronjob -func NewCreateCronjobMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "CreateCronjob", - "Create a cronjob - Creates a new cronjob for a project. The cronjob can be of type http or artifact. HTTP type cronjobs call a configured HTTP endpoint on the specified schedule. Maximum of 4 cronjobs per project.", - []byte(createCronjobInputSchema), - ) -} - -// CreateCronjobHandler is the handler function for the CreateCronjob tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func CreateCronjobHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "CreateCronjob") -} diff --git a/mcptools/CreateDeployment.go b/mcptools/CreateDeployment.go deleted file mode 100644 index 11605f9..0000000 --- a/mcptools/CreateDeployment.go +++ /dev/null @@ -1,218 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the CreateDeployment tool -const createDeploymentInputSchema = `{ - "properties": { - "body": { - "properties": { - "image": { - "description": "Docker image reference (e.g., nginx:latest, myapp:v1.0.0)", - "example": "nginx:latest", - "type": "string" - } - }, - "required": [ - "image" - ], - "type": "object" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "body" - ], - "type": "object" -}` - -// Response Template for the CreateDeployment tool (Status: 200, Content-Type: application/json) -const CreateDeploymentResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Deployment created successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **id**: Unique identifier of the created project (Type: string, uuid): - - Example: '550e8400-e29b-41d4-a716-446655440000' - - **status** (Type: string): - - Example: 'success' -` - -// Response Template for the CreateDeployment tool (Status: 400, Content-Type: application/json) -const CreateDeploymentResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - invalid image or validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateDeployment tool (Status: 401, Content-Type: application/json) -const CreateDeploymentResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateDeployment tool (Status: 403, Content-Type: application/json) -const CreateDeploymentResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateDeployment tool (Status: 404, Content-Type: application/json) -const CreateDeploymentResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateDeployment tool (Status: 422, Content-Type: application/json) -const CreateDeploymentResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Unprocessable Entity - project is not an image project or project not active - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateDeployment tool (Status: 500, Content-Type: application/json) -const CreateDeploymentResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewCreateDeploymentMCPTool creates the MCP Tool instance for CreateDeployment -func NewCreateDeploymentMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "CreateDeployment", - "Create deployment - Creates a new deployment for an image type project. The image must be a valid Docker image reference that exists in the registry. This endpoint is only available for image type projects.", - []byte(createDeploymentInputSchema), - ) -} - -// CreateDeploymentHandler is the handler function for the CreateDeployment tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func CreateDeploymentHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "CreateDeployment") -} diff --git a/mcptools/CreateDomain.go b/mcptools/CreateDomain.go deleted file mode 100644 index 24c5db7..0000000 --- a/mcptools/CreateDomain.go +++ /dev/null @@ -1,229 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the CreateDomain tool -const createDomainInputSchema = `{ - "properties": { - "body": { - "properties": { - "environmentId": { - "description": "Optional environment ID to assign the domain to", - "example": "550e8400-e29b-41d4-a716-446655440000", - "format": "uuid", - "type": [ - "string", - "null" - ] - }, - "name": { - "description": "Domain name (must be a valid domain)", - "example": "example.com", - "maxLength": 255, - "minLength": 3, - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "body" - ], - "type": "object" -}` - -// Response Template for the CreateDomain tool (Status: 201, Content-Type: application/json) -const CreateDomainResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 201 - -**Content-Type:** application/json - -> Domain created successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **id** (Type: string, uuid): - - Example: '550e8400-e29b-41d4-a716-446655440000' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the CreateDomain tool (Status: 400, Content-Type: application/json) -const CreateDomainResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - invalid domain name or validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateDomain tool (Status: 401, Content-Type: application/json) -const CreateDomainResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the CreateDomain tool (Status: 403, Content-Type: application/json) -const CreateDomainResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateDomain tool (Status: 404, Content-Type: application/json) -const CreateDomainResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateDomain tool (Status: 422, Content-Type: application/json) -const CreateDomainResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Unprocessable Entity - domain limit reached, duplicate domain, or project not active - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateDomain tool (Status: 500, Content-Type: application/json) -const CreateDomainResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewCreateDomainMCPTool creates the MCP Tool instance for CreateDomain -func NewCreateDomainMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "CreateDomain", - "Create domain - Adds a custom domain to a project. The domain must be unique and not already in use by another project.", - []byte(createDomainInputSchema), - ) -} - -// CreateDomainHandler is the handler function for the CreateDomain tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func CreateDomainHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "CreateDomain") -} diff --git a/mcptools/CreateProjectEnvironment.go b/mcptools/CreateProjectEnvironment.go deleted file mode 100644 index 3bb6cc8..0000000 --- a/mcptools/CreateProjectEnvironment.go +++ /dev/null @@ -1,348 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the CreateProjectEnvironment tool -const createProjectEnvironmentInputSchema = `{ - "properties": { - "body": { - "properties": { - "branch": { - "description": "Git branch name for VCS projects (required for VCS projects, must exist in repository). For image projects, this field should be omitted or null.", - "example": "main", - "maxLength": 255, - "minLength": 1, - "type": [ - "string", - "null" - ] - }, - "description": { - "example": "Production environment", - "maxLength": 2048, - "minLength": 4, - "type": [ - "string", - "null" - ] - }, - "displayName": { - "description": "Display name for the environment", - "example": "Production", - "maxLength": 48, - "minLength": 4, - "pattern": "^[a-zA-Z0-9 _-]+$", - "type": "string" - }, - "isAutoPromoteEnabled": { - "default": false, - "description": "Enable automatic promotion of deployments", - "example": false, - "type": "boolean" - }, - "resources": { - "properties": { - "cpu": { - "description": "CPU in millicores", - "example": 500, - "maximum": 500, - "minimum": 200, - "type": "integer" - }, - "memory": { - "description": "Memory in MB", - "example": 1024, - "maximum": 1024, - "minimum": 500, - "type": "integer" - }, - "replicas": { - "description": "Number of replicas", - "example": 2, - "maximum": 3, - "minimum": 1, - "type": "integer" - } - }, - "required": [ - "cpu", - "memory", - "replicas" - ], - "type": "object" - }, - "settings": { - "description": "Environment settings (runtime environment variables)", - "properties": { - "runEnvs": { - "additionalProperties": { - "type": "string" - }, - "example": { - "API_KEY": "prod-key", - "DATABASE_URL": "postgresql://prod-db:5432/mydb" - }, - "type": "object" - } - }, - "type": "object" - }, - "uniqueName": { - "example": "production", - "maxLength": 32, - "minLength": 4, - "pattern": "^[a-zA-Z0-9-]+$", - "type": "string" - } - }, - "required": [ - "displayName", - "uniqueName", - "description", - "settings", - "resources" - ], - "type": "object" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "body" - ], - "type": "object" -}` - -// Response Template for the CreateProjectEnvironment tool (Status: 201, Content-Type: application/json) -const CreateProjectEnvironmentResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 201 - -**Content-Type:** application/json - -> Environment created successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **id**: Unique identifier of the created project (Type: string, uuid): - - Example: '550e8400-e29b-41d4-a716-446655440000' - - **status** (Type: string): - - Example: 'success' -` - -// Response Template for the CreateProjectEnvironment tool (Status: 400, Content-Type: application/json) -const CreateProjectEnvironmentResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the CreateProjectEnvironment tool (Status: 401, Content-Type: application/json) -const CreateProjectEnvironmentResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateProjectEnvironment tool (Status: 403, Content-Type: application/json) -const CreateProjectEnvironmentResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the CreateProjectEnvironment tool (Status: 404, Content-Type: application/json) -const CreateProjectEnvironmentResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateProjectEnvironment tool (Status: 409, Content-Type: application/json) -const CreateProjectEnvironmentResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 409 - -**Content-Type:** application/json - -> Conflict - environment name already exists - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateProjectEnvironment tool (Status: 422, Content-Type: application/json) -const CreateProjectEnvironmentResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Unprocessable Entity - project not active - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateProjectEnvironment tool (Status: 429, Content-Type: application/json) -const CreateProjectEnvironmentResponseTemplate_H = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 429 - -**Content-Type:** application/json - -> Too many requests - maximum number of environments reached for the project - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateProjectEnvironment tool (Status: 500, Content-Type: application/json) -const CreateProjectEnvironmentResponseTemplate_I = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewCreateProjectEnvironmentMCPTool creates the MCP Tool instance for CreateProjectEnvironment -func NewCreateProjectEnvironmentMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "CreateProjectEnvironment", - "Create project environment - Creates a new environment for a project. For VCS projects: branch is required and must exist in the repository. For image projects: branch should be omitted or null.", - []byte(createProjectEnvironmentInputSchema), - ) -} - -// CreateProjectEnvironmentHandler is the handler function for the CreateProjectEnvironment tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func CreateProjectEnvironmentHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "CreateProjectEnvironment") -} diff --git a/mcptools/CreateProjectTemplate.go b/mcptools/CreateProjectTemplate.go deleted file mode 100644 index 814a18a..0000000 --- a/mcptools/CreateProjectTemplate.go +++ /dev/null @@ -1,304 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the CreateProjectTemplate tool -const createProjectTemplateInputSchema = `{ - "properties": { - "body": { - "properties": { - "amount": { - "default": 0, - "maximum": 5000, - "minimum": 0, - "type": "number" - }, - "buildResources": { - "description": "CPU/memory/timeout for build", - "type": "object" - }, - "categories": { - "items": { - "maxLength": 128, - "type": "string" - }, - "maxItems": 5, - "type": "array" - }, - "deploymentResources": { - "description": "CPU/memory/replicas for deployment", - "type": "object" - }, - "description": { - "maxLength": 10000, - "minLength": 100, - "type": "string" - }, - "environmentConfiguration": { - "description": "Environment settings and resources (settings, resources)", - "type": "object" - }, - "environmentId": { - "format": "uuid", - "type": "string" - }, - "imageUri": { - "maxLength": 100, - "type": "string" - }, - "name": { - "description": "Display name for the template", - "maxLength": 100, - "minLength": 10, - "type": "string" - }, - "overview": { - "maxLength": 10000, - "minLength": 100, - "type": "string" - }, - "projectConfiguration": { - "description": "VCS project settings (e.g. runtime, framework, buildCommand)", - "type": "object" - }, - "projectId": { - "format": "uuid", - "type": "string" - }, - "useCases": { - "maxLength": 10000, - "minLength": 100, - "type": "string" - }, - "videoUrl": { - "type": "string" - } - }, - "required": [ - "name", - "description", - "overview", - "projectId", - "environmentId", - "useCases", - "imageUri", - "projectConfiguration", - "environmentConfiguration", - "deploymentResources", - "buildResources" - ], - "type": "object" - } - }, - "required": [ - "body" - ], - "type": "object" -}` - -// Response Template for the CreateProjectTemplate tool (Status: 201, Content-Type: application/json) -const CreateProjectTemplateResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 201 - -**Content-Type:** application/json - -> Project template created - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **id**: Created project template ID (Type: string, uuid): - - **status** (Type: string): - - Example: 'success' -` - -// Response Template for the CreateProjectTemplate tool (Status: 400, Content-Type: application/json) -const CreateProjectTemplateResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateProjectTemplate tool (Status: 401, Content-Type: application/json) -const CreateProjectTemplateResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateProjectTemplate tool (Status: 403, Content-Type: application/json) -const CreateProjectTemplateResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the CreateProjectTemplate tool (Status: 404, Content-Type: application/json) -const CreateProjectTemplateResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Project or environment not found - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateProjectTemplate tool (Status: 422, Content-Type: application/json) -const CreateProjectTemplateResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Project not active or environment does not belong to project - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateProjectTemplate tool (Status: 429, Content-Type: application/json) -const CreateProjectTemplateResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 429 - -**Content-Type:** application/json - -> Too many draft/under-review templates (max 10) - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the CreateProjectTemplate tool (Status: 500, Content-Type: application/json) -const CreateProjectTemplateResponseTemplate_H = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewCreateProjectTemplateMCPTool creates the MCP Tool instance for CreateProjectTemplate -func NewCreateProjectTemplateMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "CreateProjectTemplate", - "Create project template - Creates a new project template in draft status from an existing project and environment. User can have at most 10 templates in draft or under review.", - []byte(createProjectTemplateInputSchema), - ) -} - -// CreateProjectTemplateHandler is the handler function for the CreateProjectTemplate tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func CreateProjectTemplateHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "CreateProjectTemplate") -} diff --git a/mcptools/DeleteApp.go b/mcptools/DeleteApp.go deleted file mode 100644 index c2d5b97..0000000 --- a/mcptools/DeleteApp.go +++ /dev/null @@ -1,181 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the DeleteApp tool -const deleteAppInputSchema = `{ - "properties": { - "app_id": { - "description": "App unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "app_id" - ], - "type": "object" -}` - -// Response Template for the DeleteApp tool (Status: 200, Content-Type: application/json) -const DeleteAppResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> App deleted successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'app deleted successfully' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the DeleteApp tool (Status: 400, Content-Type: application/json) -const DeleteAppResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeleteApp tool (Status: 401, Content-Type: application/json) -const DeleteAppResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeleteApp tool (Status: 403, Content-Type: application/json) -const DeleteAppResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the DeleteApp tool (Status: 404, Content-Type: application/json) -const DeleteAppResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeleteApp tool (Status: 500, Content-Type: application/json) -const DeleteAppResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewDeleteAppMCPTool creates the MCP Tool instance for DeleteApp -func NewDeleteAppMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "DeleteApp", - "Delete app - Deletes an app. Projects and services associated with the app will have their app_id set to null.", - []byte(deleteAppInputSchema), - ) -} - -// DeleteAppHandler is the handler function for the DeleteApp tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func DeleteAppHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "DeleteApp") -} diff --git a/mcptools/DeleteCronjob.go b/mcptools/DeleteCronjob.go deleted file mode 100644 index 50d59a8..0000000 --- a/mcptools/DeleteCronjob.go +++ /dev/null @@ -1,165 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the DeleteCronjob tool -const deleteCronjobInputSchema = `{ - "properties": { - "cronjob_id": { - "description": "Cronjob unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "cronjob_id" - ], - "type": "object" -}` - -// Response Template for the DeleteCronjob tool (Status: 200, Content-Type: application/json) -const DeleteCronjobResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Cronjob deleted successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'cronjob deleted' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the DeleteCronjob tool (Status: 401, Content-Type: application/json) -const DeleteCronjobResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeleteCronjob tool (Status: 403, Content-Type: application/json) -const DeleteCronjobResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeleteCronjob tool (Status: 404, Content-Type: application/json) -const DeleteCronjobResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeleteCronjob tool (Status: 500, Content-Type: application/json) -const DeleteCronjobResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewDeleteCronjobMCPTool creates the MCP Tool instance for DeleteCronjob -func NewDeleteCronjobMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "DeleteCronjob", - "Delete a cronjob - Deletes a cronjob. The cronjob will be soft-deleted.", - []byte(deleteCronjobInputSchema), - ) -} - -// DeleteCronjobHandler is the handler function for the DeleteCronjob tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func DeleteCronjobHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "DeleteCronjob") -} diff --git a/mcptools/DeleteDeployment.go b/mcptools/DeleteDeployment.go deleted file mode 100644 index 4a5c5fb..0000000 --- a/mcptools/DeleteDeployment.go +++ /dev/null @@ -1,209 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the DeleteDeployment tool -const deleteDeploymentInputSchema = `{ - "properties": { - "deployment_id": { - "description": "Deployment unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "deployment_id" - ], - "type": "object" -}` - -// Response Template for the DeleteDeployment tool (Status: 200, Content-Type: application/json) -const DeleteDeploymentResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Deployment deletion initiated - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'deployment is being deleted' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the DeleteDeployment tool (Status: 400, Content-Type: application/json) -const DeleteDeploymentResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeleteDeployment tool (Status: 401, Content-Type: application/json) -const DeleteDeploymentResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeleteDeployment tool (Status: 403, Content-Type: application/json) -const DeleteDeploymentResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeleteDeployment tool (Status: 404, Content-Type: application/json) -const DeleteDeploymentResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeleteDeployment tool (Status: 422, Content-Type: application/json) -const DeleteDeploymentResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Unprocessable Entity - project not active - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the DeleteDeployment tool (Status: 500, Content-Type: application/json) -const DeleteDeploymentResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// NewDeleteDeploymentMCPTool creates the MCP Tool instance for DeleteDeployment -func NewDeleteDeploymentMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "DeleteDeployment", - "Delete deployment - Marks a deployment for deletion", - []byte(deleteDeploymentInputSchema), - ) -} - -// DeleteDeploymentHandler is the handler function for the DeleteDeployment tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func DeleteDeploymentHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "DeleteDeployment") -} diff --git a/mcptools/DeleteDomain.go b/mcptools/DeleteDomain.go deleted file mode 100644 index 718818a..0000000 --- a/mcptools/DeleteDomain.go +++ /dev/null @@ -1,209 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the DeleteDomain tool -const deleteDomainInputSchema = `{ - "properties": { - "domain_id": { - "description": "Domain unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "domain_id" - ], - "type": "object" -}` - -// Response Template for the DeleteDomain tool (Status: 200, Content-Type: application/json) -const DeleteDomainResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Domain deletion initiated successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'domain is being deleted' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the DeleteDomain tool (Status: 400, Content-Type: application/json) -const DeleteDomainResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeleteDomain tool (Status: 401, Content-Type: application/json) -const DeleteDomainResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeleteDomain tool (Status: 403, Content-Type: application/json) -const DeleteDomainResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the DeleteDomain tool (Status: 404, Content-Type: application/json) -const DeleteDomainResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeleteDomain tool (Status: 422, Content-Type: application/json) -const DeleteDomainResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Unprocessable Entity - project not active - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeleteDomain tool (Status: 500, Content-Type: application/json) -const DeleteDomainResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewDeleteDomainMCPTool creates the MCP Tool instance for DeleteDomain -func NewDeleteDomainMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "DeleteDomain", - "Delete domain - Deletes a custom domain from the project", - []byte(deleteDomainInputSchema), - ) -} - -// DeleteDomainHandler is the handler function for the DeleteDomain tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func DeleteDomainHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "DeleteDomain") -} diff --git a/mcptools/DeleteProject.go b/mcptools/DeleteProject.go deleted file mode 100644 index 9899b35..0000000 --- a/mcptools/DeleteProject.go +++ /dev/null @@ -1,181 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the DeleteProject tool -const deleteProjectInputSchema = `{ - "properties": { - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id" - ], - "type": "object" -}` - -// Response Template for the DeleteProject tool (Status: 200, Content-Type: application/json) -const DeleteProjectResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Project deletion initiated - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'project is being deleted' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the DeleteProject tool (Status: 400, Content-Type: application/json) -const DeleteProjectResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeleteProject tool (Status: 401, Content-Type: application/json) -const DeleteProjectResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeleteProject tool (Status: 403, Content-Type: application/json) -const DeleteProjectResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user is not the owner or user cannot delete projects - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeleteProject tool (Status: 404, Content-Type: application/json) -const DeleteProjectResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeleteProject tool (Status: 500, Content-Type: application/json) -const DeleteProjectResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewDeleteProjectMCPTool creates the MCP Tool instance for DeleteProject -func NewDeleteProjectMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "DeleteProject", - "Delete project - Marks a project for deletion. The project will be asynchronously deleted along with all associated resources.", - []byte(deleteProjectInputSchema), - ) -} - -// DeleteProjectHandler is the handler function for the DeleteProject tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func DeleteProjectHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "DeleteProject") -} diff --git a/mcptools/DeleteProjectEnvironment.go b/mcptools/DeleteProjectEnvironment.go deleted file mode 100644 index 4a3a427..0000000 --- a/mcptools/DeleteProjectEnvironment.go +++ /dev/null @@ -1,209 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the DeleteProjectEnvironment tool -const deleteProjectEnvironmentInputSchema = `{ - "properties": { - "environment_id": { - "description": "Environment unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "environment_id" - ], - "type": "object" -}` - -// Response Template for the DeleteProjectEnvironment tool (Status: 200, Content-Type: application/json) -const DeleteProjectEnvironmentResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Environment deleted successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'project environment deleted successfully' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the DeleteProjectEnvironment tool (Status: 400, Content-Type: application/json) -const DeleteProjectEnvironmentResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeleteProjectEnvironment tool (Status: 401, Content-Type: application/json) -const DeleteProjectEnvironmentResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeleteProjectEnvironment tool (Status: 403, Content-Type: application/json) -const DeleteProjectEnvironmentResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the DeleteProjectEnvironment tool (Status: 404, Content-Type: application/json) -const DeleteProjectEnvironmentResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeleteProjectEnvironment tool (Status: 422, Content-Type: application/json) -const DeleteProjectEnvironmentResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Unprocessable Entity - environment being deleted or project not active - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeleteProjectEnvironment tool (Status: 500, Content-Type: application/json) -const DeleteProjectEnvironmentResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewDeleteProjectEnvironmentMCPTool creates the MCP Tool instance for DeleteProjectEnvironment -func NewDeleteProjectEnvironmentMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "DeleteProjectEnvironment", - "Delete project environment - Deletes a project environment", - []byte(deleteProjectEnvironmentInputSchema), - ) -} - -// DeleteProjectEnvironmentHandler is the handler function for the DeleteProjectEnvironment tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func DeleteProjectEnvironmentHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "DeleteProjectEnvironment") -} diff --git a/mcptools/DeleteProjectTemplate.go b/mcptools/DeleteProjectTemplate.go deleted file mode 100644 index b237bd6..0000000 --- a/mcptools/DeleteProjectTemplate.go +++ /dev/null @@ -1,158 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the DeleteProjectTemplate tool -const deleteProjectTemplateInputSchema = `{ - "properties": { - "template_id": { - "format": "uuid", - "type": "string" - } - }, - "required": [ - "template_id" - ], - "type": "object" -}` - -// Response Template for the DeleteProjectTemplate tool (Status: 400, Content-Type: application/json) -const DeleteProjectTemplateResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeleteProjectTemplate tool (Status: 401, Content-Type: application/json) -const DeleteProjectTemplateResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the DeleteProjectTemplate tool (Status: 403, Content-Type: application/json) -const DeleteProjectTemplateResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeleteProjectTemplate tool (Status: 404, Content-Type: application/json) -const DeleteProjectTemplateResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeleteProjectTemplate tool (Status: 500, Content-Type: application/json) -const DeleteProjectTemplateResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewDeleteProjectTemplateMCPTool creates the MCP Tool instance for DeleteProjectTemplate -func NewDeleteProjectTemplateMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "DeleteProjectTemplate", - "Delete project template - Soft-deletes the project template. User must own the template.", - []byte(deleteProjectTemplateInputSchema), - ) -} - -// DeleteProjectTemplateHandler is the handler function for the DeleteProjectTemplate tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func DeleteProjectTemplateHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "DeleteProjectTemplate") -} diff --git a/mcptools/DeployProjectTemplateViaGithub.go b/mcptools/DeployProjectTemplateViaGithub.go deleted file mode 100644 index 4a2a0e3..0000000 --- a/mcptools/DeployProjectTemplateViaGithub.go +++ /dev/null @@ -1,238 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the DeployProjectTemplateViaGithub tool -const deployProjectTemplateViaGithubInputSchema = `{ - "properties": { - "body": { - "properties": { - "installationId": { - "description": "GitHub App installation ID", - "format": "int64", - "type": "integer" - } - }, - "required": [ - "installationId" - ], - "type": "object" - }, - "purchase_id": { - "format": "uuid", - "type": "string" - } - }, - "required": [ - "purchase_id", - "body" - ], - "type": "object" -}` - -// Response Template for the DeployProjectTemplateViaGithub tool (Status: 200, Content-Type: application/json) -const DeployProjectTemplateViaGithubResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Job created; use jobId to poll status - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **jobId**: ID to poll for job status (Type: string, uuid): - - **status** (Type: string): - - Example: 'success' -` - -// Response Template for the DeployProjectTemplateViaGithub tool (Status: 400, Content-Type: application/json) -const DeployProjectTemplateViaGithubResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeployProjectTemplateViaGithub tool (Status: 401, Content-Type: application/json) -const DeployProjectTemplateViaGithubResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeployProjectTemplateViaGithub tool (Status: 403, Content-Type: application/json) -const DeployProjectTemplateViaGithubResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeployProjectTemplateViaGithub tool (Status: 404, Content-Type: application/json) -const DeployProjectTemplateViaGithubResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Purchase or template not found - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeployProjectTemplateViaGithub tool (Status: 422, Content-Type: application/json) -const DeployProjectTemplateViaGithubResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Connect a GitHub account or installation not found - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DeployProjectTemplateViaGithub tool (Status: 429, Content-Type: application/json) -const DeployProjectTemplateViaGithubResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 429 - -**Content-Type:** application/json - -> Max projects per user reached - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the DeployProjectTemplateViaGithub tool (Status: 500, Content-Type: application/json) -const DeployProjectTemplateViaGithubResponseTemplate_H = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// NewDeployProjectTemplateViaGithubMCPTool creates the MCP Tool instance for DeployProjectTemplateViaGithub -func NewDeployProjectTemplateViaGithubMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "DeployProjectTemplateViaGithub", - "Deploy purchased template via GitHub - Starts an async job to deploy the purchased template to a GitHub repository using the given installation. User must have the GitHub account connected and have capacity to create a new project.", - []byte(deployProjectTemplateViaGithubInputSchema), - ) -} - -// DeployProjectTemplateViaGithubHandler is the handler function for the DeployProjectTemplateViaGithub tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func DeployProjectTemplateViaGithubHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "DeployProjectTemplateViaGithub") -} diff --git a/mcptools/DownloadDeployment.go b/mcptools/DownloadDeployment.go deleted file mode 100644 index fb216b5..0000000 --- a/mcptools/DownloadDeployment.go +++ /dev/null @@ -1,210 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the DownloadDeployment tool -const downloadDeploymentInputSchema = `{ - "properties": { - "deployment_id": { - "description": "Deployment unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "deployment_id" - ], - "type": "object" -}` - -// Response Template for the DownloadDeployment tool (Status: 200, Content-Type: application/json) -const DownloadDeploymentResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Download URL retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **downloadUri**: Signed URL to download the deployment files (valid for 1 hour) (Type: string): - - Example: 'https://storage.example.com/files/deployment.zip?signature=...' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the DownloadDeployment tool (Status: 400, Content-Type: application/json) -const DownloadDeploymentResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DownloadDeployment tool (Status: 401, Content-Type: application/json) -const DownloadDeploymentResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DownloadDeployment tool (Status: 403, Content-Type: application/json) -const DownloadDeploymentResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the DownloadDeployment tool (Status: 404, Content-Type: application/json) -const DownloadDeploymentResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - project, deployment, or files not found - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DownloadDeployment tool (Status: 422, Content-Type: application/json) -const DownloadDeploymentResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Unprocessable Entity - project is not an upload project - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DownloadDeployment tool (Status: 500, Content-Type: application/json) -const DownloadDeploymentResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewDownloadDeploymentMCPTool creates the MCP Tool instance for DownloadDeployment -func NewDownloadDeploymentMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "DownloadDeployment", - "Download deployment files - Gets a signed URL to download the deployment files. Only available for upload type projects.", - []byte(downloadDeploymentInputSchema), - ) -} - -// DownloadDeploymentHandler is the handler function for the DownloadDeployment tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func DownloadDeploymentHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "DownloadDeployment") -} diff --git a/mcptools/DownloadProjectTemplate.go b/mcptools/DownloadProjectTemplate.go deleted file mode 100644 index f1f4336..0000000 --- a/mcptools/DownloadProjectTemplate.go +++ /dev/null @@ -1,180 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the DownloadProjectTemplate tool -const downloadProjectTemplateInputSchema = `{ - "properties": { - "purchase_id": { - "format": "uuid", - "type": "string" - } - }, - "required": [ - "purchase_id" - ], - "type": "object" -}` - -// Response Template for the DownloadProjectTemplate tool (Status: 200, Content-Type: application/json) -const DownloadProjectTemplateResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Signed download URL - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **downloadUri**: Signed URL to download the resource (Type: string, uri): - - **status** (Type: string): - - Example: 'success' -` - -// Response Template for the DownloadProjectTemplate tool (Status: 400, Content-Type: application/json) -const DownloadProjectTemplateResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DownloadProjectTemplate tool (Status: 401, Content-Type: application/json) -const DownloadProjectTemplateResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DownloadProjectTemplate tool (Status: 403, Content-Type: application/json) -const DownloadProjectTemplateResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DownloadProjectTemplate tool (Status: 404, Content-Type: application/json) -const DownloadProjectTemplateResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Purchase or template not found - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the DownloadProjectTemplate tool (Status: 500, Content-Type: application/json) -const DownloadProjectTemplateResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewDownloadProjectTemplateMCPTool creates the MCP Tool instance for DownloadProjectTemplate -func NewDownloadProjectTemplateMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "DownloadProjectTemplate", - "Get download URL for purchased template - Returns a signed URL to download the purchased template zip. Purchase must belong to the authenticated user.", - []byte(downloadProjectTemplateInputSchema), - ) -} - -// DownloadProjectTemplateHandler is the handler function for the DownloadProjectTemplate tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func DownloadProjectTemplateHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "DownloadProjectTemplate") -} diff --git a/mcptools/GetBuildLogs.go b/mcptools/GetBuildLogs.go deleted file mode 100644 index e80ad60..0000000 --- a/mcptools/GetBuildLogs.go +++ /dev/null @@ -1,221 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the GetBuildLogs tool -const getBuildLogsInputSchema = `{ - "properties": { - "deployment_id": { - "description": "Deployment unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - }, - "skip": { - "default": 0, - "description": "Number of log lines to skip", - "minimum": 0, - "type": "integer" - } - }, - "required": [ - "project_id", - "deployment_id" - ], - "type": "object" -}` - -// Response Template for the GetBuildLogs tool (Status: 200, Content-Type: application/json) -const GetBuildLogsResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Build logs retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'true' - - **data** (Type: array): - - **Items** (Type: object): - - **ts** (Type: string, date-time): - - **createdAt** (Type: string, date-time): - - **deploymentId** (Type: string, uuid): - - **lineNumber** (Type: integer, uint32): - - **log** (Type: string): - - **stage**: Stage of the deployment (e.g., build, deploy) (Type: string): -` - -// Response Template for the GetBuildLogs tool (Status: 400, Content-Type: application/json) -const GetBuildLogsResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetBuildLogs tool (Status: 401, Content-Type: application/json) -const GetBuildLogsResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetBuildLogs tool (Status: 403, Content-Type: application/json) -const GetBuildLogsResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetBuildLogs tool (Status: 404, Content-Type: application/json) -const GetBuildLogsResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetBuildLogs tool (Status: 422, Content-Type: application/json) -const GetBuildLogsResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Unprocessable Entity - project not active - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetBuildLogs tool (Status: 500, Content-Type: application/json) -const GetBuildLogsResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewGetBuildLogsMCPTool creates the MCP Tool instance for GetBuildLogs -func NewGetBuildLogsMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "GetBuildLogs", - "Get build logs - Retrieves build logs for a deployment", - []byte(getBuildLogsInputSchema), - ) -} - -// GetBuildLogsHandler is the handler function for the GetBuildLogs tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func GetBuildLogsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "GetBuildLogs") -} diff --git a/mcptools/GetCronjob.go b/mcptools/GetCronjob.go deleted file mode 100644 index d2bee4e..0000000 --- a/mcptools/GetCronjob.go +++ /dev/null @@ -1,187 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the GetCronjob tool -const getCronjobInputSchema = `{ - "properties": { - "cronjob_id": { - "description": "Cronjob unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "cronjob_id" - ], - "type": "object" -}` - -// Response Template for the GetCronjob tool (Status: 200, Content-Type: application/json) -const GetCronjobResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Cronjob retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **projectId** (Type: string, uuid): - - **schedule** (Type: string): - - **type** (Type: string): - - Enum: ['http', 'artifact'] - - **suspendText** (Type: string, nullable): - - Nullable: true - - **createdAt** (Type: string, date-time): - - **name** (Type: string): - - **id** (Type: string, uuid): - - **status** (Type: string): - - Enum: ['pending', 'building', 'active', 'suspending', 'suspended', 'deleting', 'deleted'] - - **suspendedAt** (Type: string, date-time, nullable): - - Nullable: true - - **metadata** (Type: object, nullable): - - Nullable: true - - **userRequestTerminatedAt** (Type: string, date-time, nullable): - - Nullable: true - - **updatedAt** (Type: string, date-time): - - **suspendedByOwner** (Type: boolean, nullable): - - Nullable: true - - **environmentId** (Type: string, uuid): - - **settings** (Type: object, nullable): - - Nullable: true - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the GetCronjob tool (Status: 401, Content-Type: application/json) -const GetCronjobResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetCronjob tool (Status: 403, Content-Type: application/json) -const GetCronjobResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetCronjob tool (Status: 404, Content-Type: application/json) -const GetCronjobResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetCronjob tool (Status: 500, Content-Type: application/json) -const GetCronjobResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewGetCronjobMCPTool creates the MCP Tool instance for GetCronjob -func NewGetCronjobMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "GetCronjob", - "Get a cronjob - Retrieves details of a specific cronjob.", - []byte(getCronjobInputSchema), - ) -} - -// GetCronjobHandler is the handler function for the GetCronjob tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func GetCronjobHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "GetCronjob") -} diff --git a/mcptools/GetCurrentUser.go b/mcptools/GetCurrentUser.go deleted file mode 100644 index 6ec2a09..0000000 --- a/mcptools/GetCurrentUser.go +++ /dev/null @@ -1,127 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the GetCurrentUser tool -const getCurrentUserInputSchema = `{ - "type": "object" -}` - -// Response Template for the GetCurrentUser tool (Status: 200, Content-Type: application/json) -const GetCurrentUserResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> User information retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **data**: User information from OneClick authentication service (Type: object): - - **Allows Additional Properties** - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the GetCurrentUser tool (Status: 401, Content-Type: application/json) -const GetCurrentUserResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetCurrentUser tool (Status: 403, Content-Type: application/json) -const GetCurrentUserResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user is suspended - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetCurrentUser tool (Status: 500, Content-Type: application/json) -const GetCurrentUserResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewGetCurrentUserMCPTool creates the MCP Tool instance for GetCurrentUser -func NewGetCurrentUserMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "GetCurrentUser", - "Get current user - Returns information about the currently authenticated user", - []byte(getCurrentUserInputSchema), - ) -} - -// GetCurrentUserHandler is the handler function for the GetCurrentUser tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func GetCurrentUserHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "GetCurrentUser") -} diff --git a/mcptools/GetDeploymentLogs.go b/mcptools/GetDeploymentLogs.go deleted file mode 100644 index cf5a811..0000000 --- a/mcptools/GetDeploymentLogs.go +++ /dev/null @@ -1,218 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the GetDeploymentLogs tool -const getDeploymentLogsInputSchema = `{ - "properties": { - "deployment_id": { - "description": "Deployment unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - }, - "since-seconds": { - "default": 60, - "description": "Number of seconds to look back for logs", - "type": "integer" - } - }, - "required": [ - "project_id", - "deployment_id" - ], - "type": "object" -}` - -// Response Template for the GetDeploymentLogs tool (Status: 200, Content-Type: application/json) -const GetDeploymentLogsResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Deployment logs retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: Combinator): - - **One Of the following structures**: - - **Option 1** (Type: string): - - Example: 'Listening for logs...' - - **Option 2** (Type: string): - - Example: 'log output...' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the GetDeploymentLogs tool (Status: 400, Content-Type: application/json) -const GetDeploymentLogsResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetDeploymentLogs tool (Status: 401, Content-Type: application/json) -const GetDeploymentLogsResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetDeploymentLogs tool (Status: 403, Content-Type: application/json) -const GetDeploymentLogsResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetDeploymentLogs tool (Status: 404, Content-Type: application/json) -const GetDeploymentLogsResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetDeploymentLogs tool (Status: 422, Content-Type: application/json) -const GetDeploymentLogsResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Unprocessable Entity - deployment not deployed or project not active - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetDeploymentLogs tool (Status: 500, Content-Type: application/json) -const GetDeploymentLogsResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewGetDeploymentLogsMCPTool creates the MCP Tool instance for GetDeploymentLogs -func NewGetDeploymentLogsMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "GetDeploymentLogs", - "Get deployment logs - Retrieves runtime logs for a deployed application", - []byte(getDeploymentLogsInputSchema), - ) -} - -// GetDeploymentLogsHandler is the handler function for the GetDeploymentLogs tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func GetDeploymentLogsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "GetDeploymentLogs") -} diff --git a/mcptools/GetGithubRepositoryContent.go b/mcptools/GetGithubRepositoryContent.go deleted file mode 100644 index ba74b2b..0000000 --- a/mcptools/GetGithubRepositoryContent.go +++ /dev/null @@ -1,182 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the GetGithubRepositoryContent tool -const getGithubRepositoryContentInputSchema = `{ - "properties": { - "body": { - "properties": { - "branch": { - "description": "Branch name", - "example": "main", - "type": "string" - }, - "repository": { - "description": "Repository full name (owner/repo)", - "example": "owner/repo", - "type": "string" - }, - "treeSha": { - "description": "SHA of the tree to get (optional, defaults to branch)", - "example": "abc123def456", - "type": "string" - } - }, - "required": [ - "repository", - "branch" - ], - "type": "object" - }, - "installation_id": { - "description": "GitHub App installation ID", - "type": "string" - } - }, - "required": [ - "installation_id", - "body" - ], - "type": "object" -}` - -// Response Template for the GetGithubRepositoryContent tool (Status: 200, Content-Type: application/json) -const GetGithubRepositoryContentResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Repository content retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **data**: GitHub repository tree structure (Type: object): - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the GetGithubRepositoryContent tool (Status: 400, Content-Type: application/json) -const GetGithubRepositoryContentResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetGithubRepositoryContent tool (Status: 401, Content-Type: application/json) -const GetGithubRepositoryContentResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetGithubRepositoryContent tool (Status: 404, Content-Type: application/json) -const GetGithubRepositoryContentResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetGithubRepositoryContent tool (Status: 500, Content-Type: application/json) -const GetGithubRepositoryContentResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewGetGithubRepositoryContentMCPTool creates the MCP Tool instance for GetGithubRepositoryContent -func NewGetGithubRepositoryContentMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "GetGithubRepositoryContent", - "Get repository content - Retrieves the file tree structure of a repository", - []byte(getGithubRepositoryContentInputSchema), - ) -} - -// GetGithubRepositoryContentHandler is the handler function for the GetGithubRepositoryContent tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func GetGithubRepositoryContentHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "GetGithubRepositoryContent") -} diff --git a/mcptools/GetProject.go b/mcptools/GetProject.go deleted file mode 100644 index 95be2eb..0000000 --- a/mcptools/GetProject.go +++ /dev/null @@ -1,201 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the GetProject tool -const getProjectInputSchema = `{ - "properties": { - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id" - ], - "type": "object" -}` - -// Response Template for the GetProject tool (Status: 200, Content-Type: application/json) -const GetProjectResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Project retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **userId** (Type: string): - - **settings**: Project settings (schema depends on project type) (Type: object): - - **type** (Type: string): - - Enum: ['vcs', 'image', 'upload'] - - **status** (Type: string): - - Enum: ['active', 'deleting', 'deleted'] - - **id** (Type: string, uuid): - - **enabledSecurityScan**: Whether security scanning is enabled for the project (Type: boolean): - - **updatedAt** (Type: string, date-time): - - **deletedAt** (Type: string, date-time, nullable): - - Nullable: true - - **description** (Type: string, nullable): - - Nullable: true - - **displayName** (Type: string): - - **expireAt**: Expiration time for temporary projects (e.g., GPT-created projects) (Type: string, date-time, nullable): - - Nullable: true - - **source** (Type: object): - - **appId**: App ID the project is associated with (Type: string, uuid, nullable): - - Nullable: true - - **uniqueName** (Type: string): - - **createdAt** (Type: string, date-time): - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the GetProject tool (Status: 400, Content-Type: application/json) -const GetProjectResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetProject tool (Status: 401, Content-Type: application/json) -const GetProjectResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetProject tool (Status: 403, Content-Type: application/json) -const GetProjectResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetProject tool (Status: 404, Content-Type: application/json) -const GetProjectResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProject tool (Status: 500, Content-Type: application/json) -const GetProjectResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewGetProjectMCPTool creates the MCP Tool instance for GetProject -func NewGetProjectMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "GetProject", - "Get project by ID - Retrieves detailed information about a specific project", - []byte(getProjectInputSchema), - ) -} - -// GetProjectHandler is the handler function for the GetProject tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func GetProjectHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "GetProject") -} diff --git a/mcptools/GetProjectEnvironmentAnalytics.go b/mcptools/GetProjectEnvironmentAnalytics.go deleted file mode 100644 index 2e4ee6a..0000000 --- a/mcptools/GetProjectEnvironmentAnalytics.go +++ /dev/null @@ -1,231 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the GetProjectEnvironmentAnalytics tool -const getProjectEnvironmentAnalyticsInputSchema = `{ - "properties": { - "end": { - "description": "End timestamp (Unix timestamp in seconds). Defaults to current time.", - "example": 1704070800, - "format": "int64", - "type": "integer" - }, - "environment_id": { - "description": "Environment unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - }, - "start": { - "description": "Start timestamp (Unix timestamp in seconds). Defaults to 1 hour ago.", - "example": 1704067200, - "format": "int64", - "type": "integer" - } - }, - "required": [ - "project_id", - "environment_id" - ], - "type": "object" -}` - -// Response Template for the GetProjectEnvironmentAnalytics tool (Status: 200, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Analytics retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **overallRequests** (Type: object): - - **success**: Number of successful requests (2xx status codes) (Type: number, float): - - Example: '1100' - - **total**: Total number of requests (Type: number, float): - - Example: '1250' - - **client**: Number of client error requests (4xx status codes) (Type: number, float): - - Example: '100' - - **server**: Number of server error requests (5xx status codes) (Type: number, float): - - Example: '50' - - **requestDistribution** (Type: array): - - **Items** (Type: object): - - **count**: Number of requests with this status code (Type: number, float): - - Example: '1000' - - **status**: HTTP status code (Type: string): - - Example: '200' - - **rpm** (Type: object): - - **average**: Average requests per minute (Type: number, float): - - Example: '20.8' - - **peak**: Peak requests per minute (Type: number, float): - - Example: '25.5' - - **successPercentage**: Success percentage (2xx + 3xx responses) (Type: number, float): - - Example: '88' - - **topErrorPaths** (Type: array): - - **Items** (Type: object): - - **count**: Number of error requests to this path (Type: number, float): - - Example: '20' - - **path**: Request path (Type: string): - - Example: '/api/invalid' - - **status**: HTTP status code (Type: string): - - Example: '404' - - **topHitPaths** (Type: array): - - **Items** (Type: object): - - **count**: Number of requests to this path (Type: number, float): - - Example: '500' - - **path**: Request path (Type: string): - - Example: '/api/users' -` - -// Response Template for the GetProjectEnvironmentAnalytics tool (Status: 400, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalytics tool (Status: 401, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetProjectEnvironmentAnalytics tool (Status: 403, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalytics tool (Status: 404, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalytics tool (Status: 500, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// NewGetProjectEnvironmentAnalyticsMCPTool creates the MCP Tool instance for GetProjectEnvironmentAnalytics -func NewGetProjectEnvironmentAnalyticsMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "GetProjectEnvironmentAnalytics", - "Get environment analytics - Retrieves comprehensive analytics data for a project environment including overall requests, request distribution, RPM, success percentage, top hit paths, and top error paths. Supports custom time ranges via start and end parameters.", - []byte(getProjectEnvironmentAnalyticsInputSchema), - ) -} - -// GetProjectEnvironmentAnalyticsHandler is the handler function for the GetProjectEnvironmentAnalytics tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func GetProjectEnvironmentAnalyticsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "GetProjectEnvironmentAnalytics") -} diff --git a/mcptools/GetProjectEnvironmentAnalyticsOverallRequests.go b/mcptools/GetProjectEnvironmentAnalyticsOverallRequests.go deleted file mode 100644 index 7bd6601..0000000 --- a/mcptools/GetProjectEnvironmentAnalyticsOverallRequests.go +++ /dev/null @@ -1,206 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the GetProjectEnvironmentAnalyticsOverallRequests tool -const getProjectEnvironmentAnalyticsOverallRequestsInputSchema = `{ - "properties": { - "end": { - "description": "End timestamp (Unix timestamp in seconds). Defaults to current time.", - "example": 1704070800, - "format": "int64", - "type": "integer" - }, - "environment_id": { - "description": "Environment unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - }, - "start": { - "description": "Start timestamp (Unix timestamp in seconds). Defaults to 1 hour ago.", - "example": 1704067200, - "format": "int64", - "type": "integer" - } - }, - "required": [ - "project_id", - "environment_id" - ], - "type": "object" -}` - -// Response Template for the GetProjectEnvironmentAnalyticsOverallRequests tool (Status: 200, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsOverallRequestsResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Overall request statistics retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **server**: Number of server error requests (5xx status codes) (Type: number, float): - - Example: '50' - - **success**: Number of successful requests (2xx status codes) (Type: number, float): - - Example: '1100' - - **total**: Total number of requests (Type: number, float): - - Example: '1250' - - **client**: Number of client error requests (4xx status codes) (Type: number, float): - - Example: '100' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the GetProjectEnvironmentAnalyticsOverallRequests tool (Status: 400, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsOverallRequestsResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalyticsOverallRequests tool (Status: 401, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsOverallRequestsResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalyticsOverallRequests tool (Status: 403, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsOverallRequestsResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalyticsOverallRequests tool (Status: 404, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsOverallRequestsResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalyticsOverallRequests tool (Status: 500, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsOverallRequestsResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// NewGetProjectEnvironmentAnalyticsOverallRequestsMCPTool creates the MCP Tool instance for GetProjectEnvironmentAnalyticsOverallRequests -func NewGetProjectEnvironmentAnalyticsOverallRequestsMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "GetProjectEnvironmentAnalyticsOverallRequests", - "Get overall request statistics - Retrieves overall request statistics including total requests, success (2xx), client errors (4xx), and server errors (5xx) for a project environment.", - []byte(getProjectEnvironmentAnalyticsOverallRequestsInputSchema), - ) -} - -// GetProjectEnvironmentAnalyticsOverallRequestsHandler is the handler function for the GetProjectEnvironmentAnalyticsOverallRequests tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func GetProjectEnvironmentAnalyticsOverallRequestsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "GetProjectEnvironmentAnalyticsOverallRequests") -} diff --git a/mcptools/GetProjectEnvironmentAnalyticsRPM.go b/mcptools/GetProjectEnvironmentAnalyticsRPM.go deleted file mode 100644 index 50da34b..0000000 --- a/mcptools/GetProjectEnvironmentAnalyticsRPM.go +++ /dev/null @@ -1,202 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the GetProjectEnvironmentAnalyticsRPM tool -const getProjectEnvironmentAnalyticsRPMInputSchema = `{ - "properties": { - "end": { - "description": "End timestamp (Unix timestamp in seconds). Defaults to current time.", - "example": 1704070800, - "format": "int64", - "type": "integer" - }, - "environment_id": { - "description": "Environment unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - }, - "start": { - "description": "Start timestamp (Unix timestamp in seconds). Defaults to 1 hour ago.", - "example": 1704067200, - "format": "int64", - "type": "integer" - } - }, - "required": [ - "project_id", - "environment_id" - ], - "type": "object" -}` - -// Response Template for the GetProjectEnvironmentAnalyticsRPM tool (Status: 200, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsRPMResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> RPM statistics retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **average**: Average requests per minute (Type: number, float): - - Example: '20.8' - - **peak**: Peak requests per minute (Type: number, float): - - Example: '25.5' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the GetProjectEnvironmentAnalyticsRPM tool (Status: 400, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsRPMResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalyticsRPM tool (Status: 401, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsRPMResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalyticsRPM tool (Status: 403, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsRPMResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalyticsRPM tool (Status: 404, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsRPMResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalyticsRPM tool (Status: 500, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsRPMResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// NewGetProjectEnvironmentAnalyticsRPMMCPTool creates the MCP Tool instance for GetProjectEnvironmentAnalyticsRPM -func NewGetProjectEnvironmentAnalyticsRPMMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "GetProjectEnvironmentAnalyticsRPM", - "Get RPM (Requests Per Minute) statistics - Retrieves RPM statistics including peak and average requests per minute for a project environment.", - []byte(getProjectEnvironmentAnalyticsRPMInputSchema), - ) -} - -// GetProjectEnvironmentAnalyticsRPMHandler is the handler function for the GetProjectEnvironmentAnalyticsRPM tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func GetProjectEnvironmentAnalyticsRPMHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "GetProjectEnvironmentAnalyticsRPM") -} diff --git a/mcptools/GetProjectEnvironmentAnalyticsRequestDistribution.go b/mcptools/GetProjectEnvironmentAnalyticsRequestDistribution.go deleted file mode 100644 index 0db7119..0000000 --- a/mcptools/GetProjectEnvironmentAnalyticsRequestDistribution.go +++ /dev/null @@ -1,203 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the GetProjectEnvironmentAnalyticsRequestDistribution tool -const getProjectEnvironmentAnalyticsRequestDistributionInputSchema = `{ - "properties": { - "end": { - "description": "End timestamp (Unix timestamp in seconds). Defaults to current time.", - "example": 1704070800, - "format": "int64", - "type": "integer" - }, - "environment_id": { - "description": "Environment unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - }, - "start": { - "description": "Start timestamp (Unix timestamp in seconds). Defaults to 1 hour ago.", - "example": 1704067200, - "format": "int64", - "type": "integer" - } - }, - "required": [ - "project_id", - "environment_id" - ], - "type": "object" -}` - -// Response Template for the GetProjectEnvironmentAnalyticsRequestDistribution tool (Status: 200, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsRequestDistributionResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Request distribution retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: array): - - **Items** (Type: object): - - **count**: Number of requests with this status code (Type: number, float): - - Example: '1000' - - **status**: HTTP status code (Type: string): - - Example: '200' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the GetProjectEnvironmentAnalyticsRequestDistribution tool (Status: 400, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsRequestDistributionResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetProjectEnvironmentAnalyticsRequestDistribution tool (Status: 401, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsRequestDistributionResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalyticsRequestDistribution tool (Status: 403, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsRequestDistributionResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalyticsRequestDistribution tool (Status: 404, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsRequestDistributionResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalyticsRequestDistribution tool (Status: 500, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsRequestDistributionResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// NewGetProjectEnvironmentAnalyticsRequestDistributionMCPTool creates the MCP Tool instance for GetProjectEnvironmentAnalyticsRequestDistribution -func NewGetProjectEnvironmentAnalyticsRequestDistributionMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "GetProjectEnvironmentAnalyticsRequestDistribution", - "Get request distribution by status - Retrieves request distribution grouped by HTTP status code for a project environment.", - []byte(getProjectEnvironmentAnalyticsRequestDistributionInputSchema), - ) -} - -// GetProjectEnvironmentAnalyticsRequestDistributionHandler is the handler function for the GetProjectEnvironmentAnalyticsRequestDistribution tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func GetProjectEnvironmentAnalyticsRequestDistributionHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "GetProjectEnvironmentAnalyticsRequestDistribution") -} diff --git a/mcptools/GetProjectEnvironmentAnalyticsRequestsOverTime.go b/mcptools/GetProjectEnvironmentAnalyticsRequestsOverTime.go deleted file mode 100644 index 19cb672..0000000 --- a/mcptools/GetProjectEnvironmentAnalyticsRequestsOverTime.go +++ /dev/null @@ -1,233 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the GetProjectEnvironmentAnalyticsRequestsOverTime tool -const getProjectEnvironmentAnalyticsRequestsOverTimeInputSchema = `{ - "properties": { - "end": { - "description": "End timestamp (Unix timestamp in seconds). Defaults to current time.", - "example": 1704070800, - "format": "int64", - "type": "integer" - }, - "environment_id": { - "description": "Environment unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - }, - "start": { - "description": "Start timestamp (Unix timestamp in seconds). Defaults to 1 hour ago.", - "example": 1704067200, - "format": "int64", - "type": "integer" - } - }, - "required": [ - "project_id", - "environment_id" - ], - "type": "object" -}` - -// Response Template for the GetProjectEnvironmentAnalyticsRequestsOverTime tool (Status: 200, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsRequestsOverTimeResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Requests over time data retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: array): - - **Items** (Type: object): - - **status4xx**: Number of 4xx status code responses (Type: integer): - - Example: '15' - - **status5xx**: Number of 5xx status code responses (Type: integer): - - Example: '5' - - **timestamp**: Unix timestamp in seconds (Type: integer, int64): - - Example: '1704067200' - - **count**: Total number of requests at this timestamp (Type: integer): - - Example: '150' - - **status2xx**: Number of 2xx status code responses (Type: integer): - - Example: '120' - - **status3xx**: Number of 3xx status code responses (Type: integer): - - Example: '10' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the GetProjectEnvironmentAnalyticsRequestsOverTime tool (Status: 400, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsRequestsOverTimeResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalyticsRequestsOverTime tool (Status: 401, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsRequestsOverTimeResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalyticsRequestsOverTime tool (Status: 403, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsRequestsOverTimeResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalyticsRequestsOverTime tool (Status: 404, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsRequestsOverTimeResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalyticsRequestsOverTime tool (Status: 422, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsRequestsOverTimeResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Unprocessable Entity - project not active - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalyticsRequestsOverTime tool (Status: 500, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsRequestsOverTimeResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// NewGetProjectEnvironmentAnalyticsRequestsOverTimeMCPTool creates the MCP Tool instance for GetProjectEnvironmentAnalyticsRequestsOverTime -func NewGetProjectEnvironmentAnalyticsRequestsOverTimeMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "GetProjectEnvironmentAnalyticsRequestsOverTime", - "Get requests over time - Retrieves time series data for requests broken down by status code ranges (2xx, 3xx, 4xx, 5xx) for a project environment.", - []byte(getProjectEnvironmentAnalyticsRequestsOverTimeInputSchema), - ) -} - -// GetProjectEnvironmentAnalyticsRequestsOverTimeHandler is the handler function for the GetProjectEnvironmentAnalyticsRequestsOverTime tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func GetProjectEnvironmentAnalyticsRequestsOverTimeHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "GetProjectEnvironmentAnalyticsRequestsOverTime") -} diff --git a/mcptools/GetProjectEnvironmentAnalyticsSuccessPercentage.go b/mcptools/GetProjectEnvironmentAnalyticsSuccessPercentage.go deleted file mode 100644 index c4fe9e4..0000000 --- a/mcptools/GetProjectEnvironmentAnalyticsSuccessPercentage.go +++ /dev/null @@ -1,200 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the GetProjectEnvironmentAnalyticsSuccessPercentage tool -const getProjectEnvironmentAnalyticsSuccessPercentageInputSchema = `{ - "properties": { - "end": { - "description": "End timestamp (Unix timestamp in seconds). Defaults to current time.", - "example": 1704070800, - "format": "int64", - "type": "integer" - }, - "environment_id": { - "description": "Environment unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - }, - "start": { - "description": "Start timestamp (Unix timestamp in seconds). Defaults to 1 hour ago.", - "example": 1704067200, - "format": "int64", - "type": "integer" - } - }, - "required": [ - "project_id", - "environment_id" - ], - "type": "object" -}` - -// Response Template for the GetProjectEnvironmentAnalyticsSuccessPercentage tool (Status: 200, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsSuccessPercentageResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Success percentage retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **successPercentage**: Success percentage (2xx + 3xx responses) (Type: number, float): - - Example: '88' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the GetProjectEnvironmentAnalyticsSuccessPercentage tool (Status: 400, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsSuccessPercentageResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalyticsSuccessPercentage tool (Status: 401, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsSuccessPercentageResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalyticsSuccessPercentage tool (Status: 403, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsSuccessPercentageResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalyticsSuccessPercentage tool (Status: 404, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsSuccessPercentageResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalyticsSuccessPercentage tool (Status: 500, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsSuccessPercentageResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// NewGetProjectEnvironmentAnalyticsSuccessPercentageMCPTool creates the MCP Tool instance for GetProjectEnvironmentAnalyticsSuccessPercentage -func NewGetProjectEnvironmentAnalyticsSuccessPercentageMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "GetProjectEnvironmentAnalyticsSuccessPercentage", - "Get success percentage - Retrieves the success percentage (2xx + 3xx responses) for a project environment.", - []byte(getProjectEnvironmentAnalyticsSuccessPercentageInputSchema), - ) -} - -// GetProjectEnvironmentAnalyticsSuccessPercentageHandler is the handler function for the GetProjectEnvironmentAnalyticsSuccessPercentage tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func GetProjectEnvironmentAnalyticsSuccessPercentageHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "GetProjectEnvironmentAnalyticsSuccessPercentage") -} diff --git a/mcptools/GetProjectEnvironmentAnalyticsTopErrorPaths.go b/mcptools/GetProjectEnvironmentAnalyticsTopErrorPaths.go deleted file mode 100644 index f764d25..0000000 --- a/mcptools/GetProjectEnvironmentAnalyticsTopErrorPaths.go +++ /dev/null @@ -1,205 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the GetProjectEnvironmentAnalyticsTopErrorPaths tool -const getProjectEnvironmentAnalyticsTopErrorPathsInputSchema = `{ - "properties": { - "end": { - "description": "End timestamp (Unix timestamp in seconds). Defaults to current time.", - "example": 1704070800, - "format": "int64", - "type": "integer" - }, - "environment_id": { - "description": "Environment unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - }, - "start": { - "description": "Start timestamp (Unix timestamp in seconds). Defaults to 1 hour ago.", - "example": 1704067200, - "format": "int64", - "type": "integer" - } - }, - "required": [ - "project_id", - "environment_id" - ], - "type": "object" -}` - -// Response Template for the GetProjectEnvironmentAnalyticsTopErrorPaths tool (Status: 200, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsTopErrorPathsResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Top error paths retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'true' - - **data** (Type: array): - - **Items** (Type: object): - - **count**: Number of error requests to this path (Type: number, float): - - Example: '20' - - **path**: Request path (Type: string): - - Example: '/api/invalid' - - **status**: HTTP status code (Type: string): - - Example: '404' -` - -// Response Template for the GetProjectEnvironmentAnalyticsTopErrorPaths tool (Status: 400, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsTopErrorPathsResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalyticsTopErrorPaths tool (Status: 401, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsTopErrorPathsResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalyticsTopErrorPaths tool (Status: 403, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsTopErrorPathsResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalyticsTopErrorPaths tool (Status: 404, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsTopErrorPathsResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalyticsTopErrorPaths tool (Status: 500, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsTopErrorPathsResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// NewGetProjectEnvironmentAnalyticsTopErrorPathsMCPTool creates the MCP Tool instance for GetProjectEnvironmentAnalyticsTopErrorPaths -func NewGetProjectEnvironmentAnalyticsTopErrorPathsMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "GetProjectEnvironmentAnalyticsTopErrorPaths", - "Get top 10 error paths - Retrieves the top 10 paths with the most errors (4xx and 5xx status codes) for a project environment.", - []byte(getProjectEnvironmentAnalyticsTopErrorPathsInputSchema), - ) -} - -// GetProjectEnvironmentAnalyticsTopErrorPathsHandler is the handler function for the GetProjectEnvironmentAnalyticsTopErrorPaths tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func GetProjectEnvironmentAnalyticsTopErrorPathsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "GetProjectEnvironmentAnalyticsTopErrorPaths") -} diff --git a/mcptools/GetProjectEnvironmentAnalyticsTopHitPaths.go b/mcptools/GetProjectEnvironmentAnalyticsTopHitPaths.go deleted file mode 100644 index dacd9ee..0000000 --- a/mcptools/GetProjectEnvironmentAnalyticsTopHitPaths.go +++ /dev/null @@ -1,203 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the GetProjectEnvironmentAnalyticsTopHitPaths tool -const getProjectEnvironmentAnalyticsTopHitPathsInputSchema = `{ - "properties": { - "end": { - "description": "End timestamp (Unix timestamp in seconds). Defaults to current time.", - "example": 1704070800, - "format": "int64", - "type": "integer" - }, - "environment_id": { - "description": "Environment unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - }, - "start": { - "description": "Start timestamp (Unix timestamp in seconds). Defaults to 1 hour ago.", - "example": 1704067200, - "format": "int64", - "type": "integer" - } - }, - "required": [ - "project_id", - "environment_id" - ], - "type": "object" -}` - -// Response Template for the GetProjectEnvironmentAnalyticsTopHitPaths tool (Status: 200, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsTopHitPathsResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Top hit paths retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: array): - - **Items** (Type: object): - - **count**: Number of requests to this path (Type: number, float): - - Example: '500' - - **path**: Request path (Type: string): - - Example: '/api/users' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the GetProjectEnvironmentAnalyticsTopHitPaths tool (Status: 400, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsTopHitPathsResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalyticsTopHitPaths tool (Status: 401, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsTopHitPathsResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalyticsTopHitPaths tool (Status: 403, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsTopHitPathsResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectEnvironmentAnalyticsTopHitPaths tool (Status: 404, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsTopHitPathsResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetProjectEnvironmentAnalyticsTopHitPaths tool (Status: 500, Content-Type: application/json) -const GetProjectEnvironmentAnalyticsTopHitPathsResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// NewGetProjectEnvironmentAnalyticsTopHitPathsMCPTool creates the MCP Tool instance for GetProjectEnvironmentAnalyticsTopHitPaths -func NewGetProjectEnvironmentAnalyticsTopHitPathsMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "GetProjectEnvironmentAnalyticsTopHitPaths", - "Get top 10 hit paths - Retrieves the top 10 most frequently accessed paths for a project environment.", - []byte(getProjectEnvironmentAnalyticsTopHitPathsInputSchema), - ) -} - -// GetProjectEnvironmentAnalyticsTopHitPathsHandler is the handler function for the GetProjectEnvironmentAnalyticsTopHitPaths tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func GetProjectEnvironmentAnalyticsTopHitPathsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "GetProjectEnvironmentAnalyticsTopHitPaths") -} diff --git a/mcptools/GetProjectEnvironmentLogs.go b/mcptools/GetProjectEnvironmentLogs.go deleted file mode 100644 index ccbb50a..0000000 --- a/mcptools/GetProjectEnvironmentLogs.go +++ /dev/null @@ -1,214 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the GetProjectEnvironmentLogs tool -const getProjectEnvironmentLogsInputSchema = `{ - "properties": { - "environment_id": { - "description": "Environment unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - }, - "since-seconds": { - "default": 60, - "description": "Number of seconds to look back for logs", - "type": "integer" - } - }, - "required": [ - "project_id", - "environment_id" - ], - "type": "object" -}` - -// Response Template for the GetProjectEnvironmentLogs tool (Status: 200, Content-Type: application/json) -const GetProjectEnvironmentLogsResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Logs retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'log output...' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the GetProjectEnvironmentLogs tool (Status: 400, Content-Type: application/json) -const GetProjectEnvironmentLogsResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetProjectEnvironmentLogs tool (Status: 401, Content-Type: application/json) -const GetProjectEnvironmentLogsResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetProjectEnvironmentLogs tool (Status: 403, Content-Type: application/json) -const GetProjectEnvironmentLogsResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetProjectEnvironmentLogs tool (Status: 404, Content-Type: application/json) -const GetProjectEnvironmentLogsResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetProjectEnvironmentLogs tool (Status: 422, Content-Type: application/json) -const GetProjectEnvironmentLogsResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Unprocessable Entity - environment not assigned to deployment or project not active - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetProjectEnvironmentLogs tool (Status: 500, Content-Type: application/json) -const GetProjectEnvironmentLogsResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewGetProjectEnvironmentLogsMCPTool creates the MCP Tool instance for GetProjectEnvironmentLogs -func NewGetProjectEnvironmentLogsMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "GetProjectEnvironmentLogs", - "Get environment logs - Retrieves runtime logs for a project environment", - []byte(getProjectEnvironmentLogsInputSchema), - ) -} - -// GetProjectEnvironmentLogsHandler is the handler function for the GetProjectEnvironmentLogs tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func GetProjectEnvironmentLogsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "GetProjectEnvironmentLogs") -} diff --git a/mcptools/GetProjectTemplate.go b/mcptools/GetProjectTemplate.go deleted file mode 100644 index e62ea0e..0000000 --- a/mcptools/GetProjectTemplate.go +++ /dev/null @@ -1,188 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the GetProjectTemplate tool -const getProjectTemplateInputSchema = `{ - "properties": { - "template_id": { - "format": "uuid", - "type": "string" - } - }, - "required": [ - "template_id" - ], - "type": "object" -}` - -// Response Template for the GetProjectTemplate tool (Status: 200, Content-Type: application/json) -const GetProjectTemplateResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Project template details - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **Combines All Of the following structures**: - - **Part 1**: Project template model (Type: object): - - **projectConfiguration** (Type: object): - - **environmentConfiguration** (Type: object): - - **createdAt** (Type: string, date-time): - - **description** (Type: string): - - **imageUri** (Type: string): - - **categories** (Type: array): - - **Items** (Type: string): - - **id** (Type: string, uuid): - - **buildResources** (Type: object): - - **name** (Type: string): - - **userId** (Type: string): - - **useCases** (Type: string): - - **overview** (Type: string): - - **projectId** (Type: string, uuid): - - **updatedAt** (Type: string, date-time): - - **environmentId** (Type: string, uuid): - - **status** (Type: string): - - Enum: ['draft', 'underReview', 'publishing', 'listed', 'rejected', 'deleted'] - - **deploymentResources** (Type: object): - - **videoUrl** (Type: string): - - **amount** (Type: number): - - **Part 2** (Type: object): - - **author** (Type: object): - - **id**: User ID of the author (Type: string): - - **name**: Display name or email local part (Type: string, nullable): - - Nullable: true - - **hasUserPurchased** (Type: boolean): - - **templatePurchasedId** (Type: string, uuid, nullable): - - Nullable: true - - **status** (Type: string): - - Example: 'success' -` - -// Response Template for the GetProjectTemplate tool (Status: 400, Content-Type: application/json) -const GetProjectTemplateResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetProjectTemplate tool (Status: 403, Content-Type: application/json) -const GetProjectTemplateResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - template not listed and user is not owner - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the GetProjectTemplate tool (Status: 404, Content-Type: application/json) -const GetProjectTemplateResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetProjectTemplate tool (Status: 500, Content-Type: application/json) -const GetProjectTemplateResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// NewGetProjectTemplateMCPTool creates the MCP Tool instance for GetProjectTemplate -func NewGetProjectTemplateMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "GetProjectTemplate", - "Get project template by ID - Returns a single project template by ID. Listed templates are public; draft/under review/rejected are visible only to the owner. Optional auth; when authenticated, includes purchase info.", - []byte(getProjectTemplateInputSchema), - ) -} - -// GetProjectTemplateHandler is the handler function for the GetProjectTemplate tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func GetProjectTemplateHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "GetProjectTemplate") -} diff --git a/mcptools/GetProjectTransferUri.go b/mcptools/GetProjectTransferUri.go deleted file mode 100644 index 27125d9..0000000 --- a/mcptools/GetProjectTransferUri.go +++ /dev/null @@ -1,186 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the GetProjectTransferUri tool -const getProjectTransferUriInputSchema = `{ - "properties": { - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id" - ], - "type": "object" -}` - -// Response Template for the GetProjectTransferUri tool (Status: 200, Content-Type: application/json) -const GetProjectTransferUriResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Transfer URI generated successfully - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'true' - - **data** (Type: object): - - **expiresAt**: Token expiration time (Type: string, date-time): - - Example: '2025-01-18T12:00:00Z' - - **frontendUri**: Complete frontend URL with token for accepting the transfer (Type: string): - - Example: 'https://app.example.com/projects/550e8400-e29b-41d4-a716-446655440000/transfer?token=eyJ...&source=ChatGPT' - - **token**: JWT token for project transfer (valid for 6 hours) (Type: string): - - Example: 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...' -` - -// Response Template for the GetProjectTransferUri tool (Status: 400, Content-Type: application/json) -const GetProjectTransferUriResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - project not in active state - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetProjectTransferUri tool (Status: 401, Content-Type: application/json) -const GetProjectTransferUriResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetProjectTransferUri tool (Status: 403, Content-Type: application/json) -const GetProjectTransferUriResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetProjectTransferUri tool (Status: 404, Content-Type: application/json) -const GetProjectTransferUriResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetProjectTransferUri tool (Status: 500, Content-Type: application/json) -const GetProjectTransferUriResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewGetProjectTransferUriMCPTool creates the MCP Tool instance for GetProjectTransferUri -func NewGetProjectTransferUriMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "GetProjectTransferUri", - "Get project transfer URI - Generates a transfer URI and token that can be used to transfer project ownership to another user. The token is valid for 6 hours.", - []byte(getProjectTransferUriInputSchema), - ) -} - -// GetProjectTransferUriHandler is the handler function for the GetProjectTransferUri tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func GetProjectTransferUriHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "GetProjectTransferUri") -} diff --git a/mcptools/GetSecurityScan.go b/mcptools/GetSecurityScan.go deleted file mode 100644 index 691a8a5..0000000 --- a/mcptools/GetSecurityScan.go +++ /dev/null @@ -1,213 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the GetSecurityScan tool -const getSecurityScanInputSchema = `{ - "properties": { - "deployment_id": { - "description": "Deployment unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "deployment_id" - ], - "type": "object" -}` - -// Response Template for the GetSecurityScan tool (Status: 200, Content-Type: application/json) -const GetSecurityScanResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Security scan report retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **type**: Type of security scan (Type: string): - - Example: 'vulnerability' - - **deploymentId**: Deployment ID this report belongs to (Type: string, uuid): - - Example: '550e8400-e29b-41d4-a716-446655440001' - - **parsedReport**: Parsed security scan results (Type: object, nullable): - - Nullable: true - - **Allows Additional Properties** - - **deletedAt**: When the report was deleted (Type: string, date-time, nullable): - - Nullable: true - - **failedReason**: Reason for failure if status is failed (Type: string, nullable): - - Nullable: true - - **id**: Security scan report ID (Type: string, uuid): - - Example: '550e8400-e29b-41d4-a716-446655440000' - - **tool**: Security scanning tool used (Type: string): - - Example: 'trivy' - - **expiresAt**: When the scan job times out (Type: string, date-time): - - Example: '2025-01-18T12:00:00Z' - - **executor**: Worker that executed the scan (Type: string, nullable): - - Nullable: true - - Example: 'worker-1' - - **status**: Current status of the security scan (Type: string): - - Example: 'success' - - Enum: ['pending', 'in_progress', 'success', 'failed'] - - **updatedAt**: When the report was last updated (Type: string, date-time): - - Example: '2025-01-17T12:30:00Z' - - **createdAt**: When the report was created (Type: string, date-time): - - Example: '2025-01-17T12:00:00Z' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the GetSecurityScan tool (Status: 400, Content-Type: application/json) -const GetSecurityScanResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetSecurityScan tool (Status: 401, Content-Type: application/json) -const GetSecurityScanResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetSecurityScan tool (Status: 403, Content-Type: application/json) -const GetSecurityScanResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetSecurityScan tool (Status: 404, Content-Type: application/json) -const GetSecurityScanResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - project, deployment, or security scan report not found - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetSecurityScan tool (Status: 500, Content-Type: application/json) -const GetSecurityScanResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewGetSecurityScanMCPTool creates the MCP Tool instance for GetSecurityScan -func NewGetSecurityScanMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "GetSecurityScan", - "Get security scan report - Retrieves the security scan report for a deployment", - []byte(getSecurityScanInputSchema), - ) -} - -// GetSecurityScanHandler is the handler function for the GetSecurityScan tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func GetSecurityScanHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "GetSecurityScan") -} diff --git a/mcptools/GetSecurityScanDownloadUri.go b/mcptools/GetSecurityScanDownloadUri.go deleted file mode 100644 index 608d557..0000000 --- a/mcptools/GetSecurityScanDownloadUri.go +++ /dev/null @@ -1,188 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the GetSecurityScanDownloadUri tool -const getSecurityScanDownloadUriInputSchema = `{ - "properties": { - "deployment_id": { - "description": "Deployment unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "deployment_id" - ], - "type": "object" -}` - -// Response Template for the GetSecurityScanDownloadUri tool (Status: 200, Content-Type: application/json) -const GetSecurityScanDownloadUriResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Download URL retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'true' - - **data** (Type: object): - - **downloadUri**: Signed URL to download the security scan report (valid for 1 hour) (Type: string): - - Example: 'https://storage.example.com/reports/scan.json?signature=...' -` - -// Response Template for the GetSecurityScanDownloadUri tool (Status: 400, Content-Type: application/json) -const GetSecurityScanDownloadUriResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetSecurityScanDownloadUri tool (Status: 401, Content-Type: application/json) -const GetSecurityScanDownloadUriResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetSecurityScanDownloadUri tool (Status: 403, Content-Type: application/json) -const GetSecurityScanDownloadUriResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetSecurityScanDownloadUri tool (Status: 404, Content-Type: application/json) -const GetSecurityScanDownloadUriResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - project, deployment, security scan report not found, or report not successful - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the GetSecurityScanDownloadUri tool (Status: 500, Content-Type: application/json) -const GetSecurityScanDownloadUriResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewGetSecurityScanDownloadUriMCPTool creates the MCP Tool instance for GetSecurityScanDownloadUri -func NewGetSecurityScanDownloadUriMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "GetSecurityScanDownloadUri", - "Download security scan report - Gets a signed URL to download the full security scan report. Only available when the scan status is successful.", - []byte(getSecurityScanDownloadUriInputSchema), - ) -} - -// GetSecurityScanDownloadUriHandler is the handler function for the GetSecurityScanDownloadUri tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func GetSecurityScanDownloadUriHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "GetSecurityScanDownloadUri") -} diff --git a/mcptools/InstallGithubApp.go b/mcptools/InstallGithubApp.go deleted file mode 100644 index 29220b6..0000000 --- a/mcptools/InstallGithubApp.go +++ /dev/null @@ -1,218 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the InstallGithubApp tool -const installGithubAppInputSchema = `{ - "properties": { - "body": { - "properties": { - "code": { - "description": "OAuth code received from GitHub after user authorizes the app", - "example": "abc123def456", - "type": "string" - }, - "installationId": { - "description": "GitHub App installation ID", - "example": 12345678, - "format": "int64", - "type": "integer" - } - }, - "required": [ - "installationId", - "code" - ], - "type": "object" - } - }, - "required": [ - "body" - ], - "type": "object" -}` - -// Response Template for the InstallGithubApp tool (Status: 200, Content-Type: application/json) -const InstallGithubAppResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Installation authorized successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'installation authorized successfully' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the InstallGithubApp tool (Status: 400, Content-Type: application/json) -const InstallGithubAppResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the InstallGithubApp tool (Status: 401, Content-Type: application/json) -const InstallGithubAppResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the InstallGithubApp tool (Status: 403, Content-Type: application/json) -const InstallGithubAppResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user not authorized to access installation - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the InstallGithubApp tool (Status: 404, Content-Type: application/json) -const InstallGithubAppResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - installation not found - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the InstallGithubApp tool (Status: 409, Content-Type: application/json) -const InstallGithubAppResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 409 - -**Content-Type:** application/json - -> Conflict - installation already exists - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the InstallGithubApp tool (Status: 500, Content-Type: application/json) -const InstallGithubAppResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewInstallGithubAppMCPTool creates the MCP Tool instance for InstallGithubApp -func NewInstallGithubAppMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "InstallGithubApp", - "Install GitHub App - Connects a GitHub App installation to the user's account", - []byte(installGithubAppInputSchema), - ) -} - -// InstallGithubAppHandler is the handler function for the InstallGithubApp tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func InstallGithubAppHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "InstallGithubApp") -} diff --git a/mcptools/ListAPIKeys.go b/mcptools/ListAPIKeys.go deleted file mode 100644 index dbc6cc9..0000000 --- a/mcptools/ListAPIKeys.go +++ /dev/null @@ -1,139 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the ListAPIKeys tool -const listAPIKeysInputSchema = `{ - "type": "object" -}` - -// Response Template for the ListAPIKeys tool (Status: 200, Content-Type: application/json) -const ListAPIKeysResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> API keys retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: array): - - **Items** (Type: object): - - **createdAt** (Type: string, date-time): - - **description** (Type: string, nullable): - - Nullable: true - - **expiredAt** (Type: string, date-time, nullable): - - Nullable: true - - **id** (Type: string, uuid): - - **name** (Type: string, nullable): - - Nullable: true - - **revokedAt** (Type: string, date-time, nullable): - - Nullable: true - - **updatedAt** (Type: string, date-time): - - **userId** (Type: string): - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the ListAPIKeys tool (Status: 401, Content-Type: application/json) -const ListAPIKeysResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListAPIKeys tool (Status: 404, Content-Type: application/json) -const ListAPIKeysResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - no API keys found - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListAPIKeys tool (Status: 500, Content-Type: application/json) -const ListAPIKeysResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewListAPIKeysMCPTool creates the MCP Tool instance for ListAPIKeys -func NewListAPIKeysMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "ListAPIKeys", - "List API keys - Returns all API keys for the authenticated user", - []byte(listAPIKeysInputSchema), - ) -} - -// ListAPIKeysHandler is the handler function for the ListAPIKeys tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func ListAPIKeysHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "ListAPIKeys") -} diff --git a/mcptools/ListApps.go b/mcptools/ListApps.go deleted file mode 100644 index b91e162..0000000 --- a/mcptools/ListApps.go +++ /dev/null @@ -1,117 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the ListApps tool -const listAppsInputSchema = `{ - "type": "object" -}` - -// Response Template for the ListApps tool (Status: 200, Content-Type: application/json) -const ListAppsResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Apps retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: array): - - **Items** (Type: object): - - **updatedAt** (Type: string, date-time): - - **userId**: User ID of the app owner (Type: string): - - **color**: Hex color code for the app (Type: string): - - Example: '#3B82F6' - - **createdAt** (Type: string, date-time): - - **description**: Description of the app (Type: string, nullable): - - Nullable: true - - Example: 'A collection of related projects and services' - - **id**: Unique identifier of the app (Type: string, uuid): - - Example: '550e8400-e29b-41d4-a716-446655440000' - - **name**: Name of the app (Type: string): - - Example: 'My Application' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the ListApps tool (Status: 401, Content-Type: application/json) -const ListAppsResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListApps tool (Status: 500, Content-Type: application/json) -const ListAppsResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewListAppsMCPTool creates the MCP Tool instance for ListApps -func NewListAppsMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "ListApps", - "List apps - Returns all apps for the authenticated user", - []byte(listAppsInputSchema), - ) -} - -// ListAppsHandler is the handler function for the ListApps tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func ListAppsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "ListApps") -} diff --git a/mcptools/ListConnectedGithubAccounts.go b/mcptools/ListConnectedGithubAccounts.go deleted file mode 100644 index 988de6d..0000000 --- a/mcptools/ListConnectedGithubAccounts.go +++ /dev/null @@ -1,109 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the ListConnectedGithubAccounts tool -const listConnectedGithubAccountsInputSchema = `{ - "type": "object" -}` - -// Response Template for the ListConnectedGithubAccounts tool (Status: 200, Content-Type: application/json) -const ListConnectedGithubAccountsResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Connected accounts retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: array): - - **Items** (Type: object): - - **avatarUrl** (Type: string): - - **installationId** (Type: integer, int64): - - **ownerId** (Type: integer, int64): - - **username** (Type: string): - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the ListConnectedGithubAccounts tool (Status: 401, Content-Type: application/json) -const ListConnectedGithubAccountsResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListConnectedGithubAccounts tool (Status: 500, Content-Type: application/json) -const ListConnectedGithubAccountsResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewListConnectedGithubAccountsMCPTool creates the MCP Tool instance for ListConnectedGithubAccounts -func NewListConnectedGithubAccountsMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "ListConnectedGithubAccounts", - "List connected GitHub accounts - Returns a list of all GitHub accounts connected to the user", - []byte(listConnectedGithubAccountsInputSchema), - ) -} - -// ListConnectedGithubAccountsHandler is the handler function for the ListConnectedGithubAccounts tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func ListConnectedGithubAccountsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "ListConnectedGithubAccounts") -} diff --git a/mcptools/ListCronjobActivities.go b/mcptools/ListCronjobActivities.go deleted file mode 100644 index 6416c2b..0000000 --- a/mcptools/ListCronjobActivities.go +++ /dev/null @@ -1,175 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the ListCronjobActivities tool -const listCronjobActivitiesInputSchema = `{ - "properties": { - "cronjob_id": { - "description": "Cronjob unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "cronjob_id" - ], - "type": "object" -}` - -// Response Template for the ListCronjobActivities tool (Status: 200, Content-Type: application/json) -const ListCronjobActivitiesResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Cronjob activities retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: array): - - **Items** (Type: object): - - **success** (Type: boolean, nullable): - - Nullable: true - - **createdAt** (Type: string, date-time): - - **cronJobId** (Type: string, uuid): - - **id** (Type: string, uuid): - - **log** (Type: string, nullable): - - Nullable: true - - **scheduledAt** (Type: string, date-time): - - **statusCode** (Type: integer, nullable): - - Nullable: true - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the ListCronjobActivities tool (Status: 401, Content-Type: application/json) -const ListCronjobActivitiesResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListCronjobActivities tool (Status: 403, Content-Type: application/json) -const ListCronjobActivitiesResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListCronjobActivities tool (Status: 404, Content-Type: application/json) -const ListCronjobActivitiesResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListCronjobActivities tool (Status: 500, Content-Type: application/json) -const ListCronjobActivitiesResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewListCronjobActivitiesMCPTool creates the MCP Tool instance for ListCronjobActivities -func NewListCronjobActivitiesMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "ListCronjobActivities", - "List cronjob activities - Retrieves the last 10 execution activities for a cronjob, including status codes, success/failure, and logs.", - []byte(listCronjobActivitiesInputSchema), - ) -} - -// ListCronjobActivitiesHandler is the handler function for the ListCronjobActivities tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func ListCronjobActivitiesHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "ListCronjobActivities") -} diff --git a/mcptools/ListCronjobs.go b/mcptools/ListCronjobs.go deleted file mode 100644 index fa7ccfa..0000000 --- a/mcptools/ListCronjobs.go +++ /dev/null @@ -1,182 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the ListCronjobs tool -const listCronjobsInputSchema = `{ - "properties": { - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id" - ], - "type": "object" -}` - -// Response Template for the ListCronjobs tool (Status: 200, Content-Type: application/json) -const ListCronjobsResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Cronjobs retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: array): - - **Items** (Type: object): - - **projectId** (Type: string, uuid): - - **schedule** (Type: string): - - **type** (Type: string): - - Enum: ['http', 'artifact'] - - **suspendText** (Type: string, nullable): - - Nullable: true - - **createdAt** (Type: string, date-time): - - **name** (Type: string): - - **id** (Type: string, uuid): - - **status** (Type: string): - - Enum: ['pending', 'building', 'active', 'suspending', 'suspended', 'deleting', 'deleted'] - - **suspendedAt** (Type: string, date-time, nullable): - - Nullable: true - - **metadata** (Type: object, nullable): - - Nullable: true - - **userRequestTerminatedAt** (Type: string, date-time, nullable): - - Nullable: true - - **updatedAt** (Type: string, date-time): - - **suspendedByOwner** (Type: boolean, nullable): - - Nullable: true - - **environmentId** (Type: string, uuid): - - **settings** (Type: object, nullable): - - Nullable: true - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the ListCronjobs tool (Status: 401, Content-Type: application/json) -const ListCronjobsResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListCronjobs tool (Status: 403, Content-Type: application/json) -const ListCronjobsResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListCronjobs tool (Status: 404, Content-Type: application/json) -const ListCronjobsResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListCronjobs tool (Status: 500, Content-Type: application/json) -const ListCronjobsResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewListCronjobsMCPTool creates the MCP Tool instance for ListCronjobs -func NewListCronjobsMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "ListCronjobs", - "List cronjobs - Lists all cronjobs for a project.", - []byte(listCronjobsInputSchema), - ) -} - -// ListCronjobsHandler is the handler function for the ListCronjobs tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func ListCronjobsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "ListCronjobs") -} diff --git a/mcptools/ListDeployments.go b/mcptools/ListDeployments.go deleted file mode 100644 index 452985e..0000000 --- a/mcptools/ListDeployments.go +++ /dev/null @@ -1,318 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the ListDeployments tool -const listDeploymentsInputSchema = `{ - "properties": { - "limit": { - "default": 10, - "description": "Maximum number of deployments to return (default: 10, max: 20)", - "maximum": 20, - "minimum": 1, - "type": "integer" - }, - "offset": { - "default": 0, - "description": "Number of deployments to skip (default: 0)", - "minimum": 0, - "type": "integer" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id" - ], - "type": "object" -}` - -// Response Template for the ListDeployments tool (Status: 200, Content-Type: application/json) -const ListDeploymentsResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Deployments retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **pagination** (Type: object): - - **count**: Number of items in the current page (Type: integer): - - Example: '10' - - **limit**: Maximum number of items per page (Type: integer): - - Example: '10' - - **offset**: Number of items skipped (Type: integer): - - Example: '0' - - **total**: Total number of items available (Type: integer): - - Example: '100' - - **data** (Type: array): - - **Items** (Type: object): - - **cancelReason** (Type: string, nullable): - - Nullable: true - - **id** (Type: string, uuid): - - **status** (Type: string): - - Enum: ['queue', 'building', 'deploying', 'deployed', 'build_error', 'crashing', 'cancelled', 'error', 'sleeping', 'terminating'] - - **artifactImage** (Type: string, nullable): - - Nullable: true - - **createdAt** (Type: string, date-time): - - **extra**: Additional deployment information (URLs, etc.) (Type: object): - - **Additional Properties**: - - **property value** (Type: string): - - **cancelledAt** (Type: string, date-time, nullable): - - Nullable: true - - **projectId** (Type: string, uuid): - - **settings**: Build and runtime settings for VCS projects (Type: object): - - **installCommand**: Command to install dependencies (Type: string, nullable): - - Max Length: 255 - - Nullable: true - - Example: 'npm install' - - **runCommand**: Command to run the application (Type: string, nullable): - - Max Length: 255 - - Nullable: true - - Example: 'npm run start' - - **useBuildAI**: Whether to use Build AI for automated build configuration (Type: boolean): - - Default: 'false' - - Example: 'false' - - **ignoreBranches**: List of exact branch names to ignore for automatic deployments (not regex patterns) (Type: array): - - Example: '["develop","staging"]' - - **Items** (Type: string): - - Max Length: 255 - - **runFlag**: Additional flags to pass to the run command (Type: string, nullable): - - Max Length: 255 - - Nullable: true - - **buildDir**: Directory where build output is located (Type: string, nullable): - - Max Length: 255 - - Nullable: true - - Example: 'dist' - - **buildVars**: Build-time environment variables (alternative to buildFlags) (Type: object): - - Max Length: 255 - - Example: '{"NEXT_PUBLIC_API_URL":"https://api.example.com","NODE_ENV":"production"}' - - **Additional Properties**: - - **property value** (Type: string): - - **framework**: Framework name (e.g., nextjs, reactjs-spa, reactjs-ssr). If specified, runtime must be compatible. (Type: string, nullable): - - Max Length: 255 - - Nullable: true - - Example: 'nextjs' - - **buildFlag**: Additional flags to pass to the build command (Type: string, nullable): - - Max Length: 255 - - Nullable: true - - Example: '-trimpath' - - **hasDockerfile**: Whether the project has a Dockerfile (if true, build settings may be ignored) (Type: boolean): - - Default: 'false' - - Example: 'false' - - **directoryPath**: Project directory path within the repository (defaults to root) (Type: string, nullable): - - Max Length: 255 - - Nullable: true - - Example: '.' - - **buildFlags**: Build-time environment variables (also accepts buildVars) (Type: object): - - Max Length: 255 - - Example: '{"NEXT_PUBLIC_API_URL":"https://api.example.com","NODE_ENV":"production"}' - - **Additional Properties**: - - **property value** (Type: string): - - **port**: Port number the application listens on (Type: integer): - - Minimum: 1 - - Maximum: 65535 - - Example: '3000' - - **buildCommand**: Command to build the project (Type: string, nullable): - - Max Length: 255 - - Nullable: true - - Example: 'npm run build' - - **runEnvs**: Runtime environment variables (Type: object): - - Max Length: 255 - - Example: '{"API_KEY":"secret-key","DATABASE_URL":"postgresql://localhost:5432/mydb"}' - - **Additional Properties**: - - **property value** (Type: string): - - **runtime**: Runtime environment (e.g., node:20, golang:1.25, bun:1.3). Required if framework is not specified. (Type: string, nullable): - - Max Length: 255 - - Nullable: true - - Example: 'node:20' - - **source**: Deployment source information. For VCS projects: contains branch, commit, and commitMessage. For image projects: contains the image reference. (Type: Combinator): - - **One Of the following structures**: - - **Option 1**: Source for VCS deployments (Type: object): - - **branch**: Git branch name (Type: string): - - Example: 'main' - - **commit**: Git commit SHA (Type: string): - - Example: 'abc123def456' - - **commitMessage**: Git commit message (Type: string): - - Example: 'Fix bug in authentication' - - **Option 2**: Source for image deployments (Type: object): - - **image**: Docker image reference (Type: string): - - Example: 'nginx:latest' - - **updatedAt** (Type: string, date-time): - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the ListDeployments tool (Status: 400, Content-Type: application/json) -const ListDeploymentsResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListDeployments tool (Status: 401, Content-Type: application/json) -const ListDeploymentsResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListDeployments tool (Status: 403, Content-Type: application/json) -const ListDeploymentsResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListDeployments tool (Status: 404, Content-Type: application/json) -const ListDeploymentsResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListDeployments tool (Status: 422, Content-Type: application/json) -const ListDeploymentsResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Unprocessable Entity - project not active - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListDeployments tool (Status: 500, Content-Type: application/json) -const ListDeploymentsResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewListDeploymentsMCPTool creates the MCP Tool instance for ListDeployments -func NewListDeploymentsMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "ListDeployments", - "List deployments - Returns all deployments for a project", - []byte(listDeploymentsInputSchema), - ) -} - -// ListDeploymentsHandler is the handler function for the ListDeployments tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func ListDeploymentsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "ListDeployments") -} diff --git a/mcptools/ListDomains.go b/mcptools/ListDomains.go deleted file mode 100644 index a0f3112..0000000 --- a/mcptools/ListDomains.go +++ /dev/null @@ -1,232 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the ListDomains tool -const listDomainsInputSchema = `{ - "properties": { - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id" - ], - "type": "object" -}` - -// Response Template for the ListDomains tool (Status: 200, Content-Type: application/json) -const ListDomainsResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Domains retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'true' - - **data** (Type: array): - - **Items** (Type: object): - - **lastFailedVerifiedAt**: Timestamp of last failed verification attempt (Type: string, date-time, nullable): - - Nullable: true - - **updatedAt**: When the domain was last updated (Type: string, date-time): - - Example: '2025-01-17T12:00:00Z' - - **projectId**: Project ID this domain belongs to (Type: string, uuid): - - Example: '550e8400-e29b-41d4-a716-446655440001' - - **deletingAt**: When the domain deletion was initiated (Type: string, date-time, nullable): - - Nullable: true - - **environmentId**: Desired environment ID for this domain (Type: string, uuid, nullable): - - Nullable: true - - Example: '550e8400-e29b-41d4-a716-446655440002' - - **name**: Domain name (Type: string): - - Example: 'example.com' - - **records**: DNS records required for domain verification (Type: object): - - **Allows Additional Properties** - - **status**: Current status of the domain (Type: string): - - Example: 'active' - - Enum: ['pending', 'issuing', 'updating', 'active', 'error', 'deleting'] - - **createdAt**: When the domain was created (Type: string, date-time): - - Example: '2025-01-17T12:00:00Z' - - **domainCertificateId**: Associated SSL certificate ID (Type: string, uuid, nullable): - - Nullable: true - - Example: '550e8400-e29b-41d4-a716-446655440003' - - **failedVerificationCount**: Number of failed DNS verification attempts (Type: integer): - - Example: '0' - - **id**: Domain unique identifier (Type: string, uuid): - - Example: '550e8400-e29b-41d4-a716-446655440000' - - **message**: Error or status message (Type: string, nullable): - - Nullable: true -` - -// Response Template for the ListDomains tool (Status: 400, Content-Type: application/json) -const ListDomainsResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListDomains tool (Status: 401, Content-Type: application/json) -const ListDomainsResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListDomains tool (Status: 403, Content-Type: application/json) -const ListDomainsResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListDomains tool (Status: 404, Content-Type: application/json) -const ListDomainsResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListDomains tool (Status: 422, Content-Type: application/json) -const ListDomainsResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Unprocessable Entity - project is not active - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListDomains tool (Status: 500, Content-Type: application/json) -const ListDomainsResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewListDomainsMCPTool creates the MCP Tool instance for ListDomains -func NewListDomainsMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "ListDomains", - "List domains - Returns all custom domains for a project", - []byte(listDomainsInputSchema), - ) -} - -// ListDomainsHandler is the handler function for the ListDomains tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func ListDomainsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "ListDomains") -} diff --git a/mcptools/ListGithubRepositories.go b/mcptools/ListGithubRepositories.go deleted file mode 100644 index 63cb663..0000000 --- a/mcptools/ListGithubRepositories.go +++ /dev/null @@ -1,163 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the ListGithubRepositories tool -const listGithubRepositoriesInputSchema = `{ - "properties": { - "installation_id": { - "description": "GitHub App installation ID", - "type": "string" - } - }, - "required": [ - "installation_id" - ], - "type": "object" -}` - -// Response Template for the ListGithubRepositories tool (Status: 200, Content-Type: application/json) -const ListGithubRepositoriesResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Repositories retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: array): - - **Items** (Type: object): - - **fullName** (Type: string): - - **id** (Type: integer, int64): - - **name** (Type: string): - - **private** (Type: boolean): - - **defaultBranch** (Type: string): - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the ListGithubRepositories tool (Status: 400, Content-Type: application/json) -const ListGithubRepositoriesResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListGithubRepositories tool (Status: 401, Content-Type: application/json) -const ListGithubRepositoriesResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListGithubRepositories tool (Status: 404, Content-Type: application/json) -const ListGithubRepositoriesResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListGithubRepositories tool (Status: 500, Content-Type: application/json) -const ListGithubRepositoriesResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewListGithubRepositoriesMCPTool creates the MCP Tool instance for ListGithubRepositories -func NewListGithubRepositoriesMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "ListGithubRepositories", - "List GitHub repositories - Lists all repositories accessible through a GitHub installation", - []byte(listGithubRepositoriesInputSchema), - ) -} - -// ListGithubRepositoriesHandler is the handler function for the ListGithubRepositories tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func ListGithubRepositoriesHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "ListGithubRepositories") -} diff --git a/mcptools/ListGithubRepositoryBranches.go b/mcptools/ListGithubRepositoryBranches.go deleted file mode 100644 index 257dcc2..0000000 --- a/mcptools/ListGithubRepositoryBranches.go +++ /dev/null @@ -1,190 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the ListGithubRepositoryBranches tool -const listGithubRepositoryBranchesInputSchema = `{ - "properties": { - "installation_id": { - "description": "GitHub App installation ID", - "type": "string" - }, - "page": { - "default": 1, - "description": "Page number for pagination", - "minimum": 1, - "type": "integer" - }, - "per-page": { - "default": 30, - "description": "Number of items per page", - "maximum": 100, - "minimum": 1, - "type": "integer" - }, - "protected": { - "description": "Filter by protected status", - "enum": [ - "true", - "false" - ], - "type": "string" - }, - "repository": { - "description": "Repository full name (owner/repo)", - "example": "owner/repo", - "type": "string" - } - }, - "required": [ - "installation_id", - "repository" - ], - "type": "object" -}` - -// Response Template for the ListGithubRepositoryBranches tool (Status: 200, Content-Type: application/json) -const ListGithubRepositoryBranchesResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Branches retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: array): - - **Items** (Type: object): - - **name** (Type: string): - - **protected** (Type: boolean): - - **commit** (Type: object): - - **sha** (Type: string): - - **url** (Type: string): - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the ListGithubRepositoryBranches tool (Status: 400, Content-Type: application/json) -const ListGithubRepositoryBranchesResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListGithubRepositoryBranches tool (Status: 401, Content-Type: application/json) -const ListGithubRepositoryBranchesResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListGithubRepositoryBranches tool (Status: 404, Content-Type: application/json) -const ListGithubRepositoryBranchesResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListGithubRepositoryBranches tool (Status: 500, Content-Type: application/json) -const ListGithubRepositoryBranchesResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewListGithubRepositoryBranchesMCPTool creates the MCP Tool instance for ListGithubRepositoryBranches -func NewListGithubRepositoryBranchesMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "ListGithubRepositoryBranches", - "List repository branches - Lists all branches for a GitHub repository", - []byte(listGithubRepositoryBranchesInputSchema), - ) -} - -// ListGithubRepositoryBranchesHandler is the handler function for the ListGithubRepositoryBranches tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func ListGithubRepositoryBranchesHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "ListGithubRepositoryBranches") -} diff --git a/mcptools/ListMyProjectTemplates.go b/mcptools/ListMyProjectTemplates.go deleted file mode 100644 index 1f9eaf6..0000000 --- a/mcptools/ListMyProjectTemplates.go +++ /dev/null @@ -1,159 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the ListMyProjectTemplates tool -const listMyProjectTemplatesInputSchema = `{ - "properties": { - "limit": { - "default": 10, - "maximum": 20, - "minimum": 1, - "type": "integer" - }, - "offset": { - "default": 0, - "minimum": 0, - "type": "integer" - } - }, - "type": "object" -}` - -// Response Template for the ListMyProjectTemplates tool (Status: 200, Content-Type: application/json) -const ListMyProjectTemplatesResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> List of user's project templates - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **pagination** (Type: object): - - **count**: Number of items in the current page (Type: integer): - - Example: '10' - - **limit**: Maximum number of items per page (Type: integer): - - Example: '10' - - **offset**: Number of items skipped (Type: integer): - - Example: '0' - - **total**: Total number of items available (Type: integer): - - Example: '100' - - **templates** (Type: array): - - **Items** (Type: object): - - **Combines All Of the following structures**: - - **Part 1**: Project template model (Type: object): - - **projectId** (Type: string, uuid): - - **updatedAt** (Type: string, date-time): - - **environmentId** (Type: string, uuid): - - **status** (Type: string): - - Enum: ['draft', 'underReview', 'publishing', 'listed', 'rejected', 'deleted'] - - **overview** (Type: string): - - **videoUrl** (Type: string): - - **amount** (Type: number): - - **deploymentResources** (Type: object): - - **environmentConfiguration** (Type: object): - - **createdAt** (Type: string, date-time): - - **projectConfiguration** (Type: object): - - **imageUri** (Type: string): - - **categories** (Type: array): - - **Items** (Type: string): - - **id** (Type: string, uuid): - - **buildResources** (Type: object): - - **name** (Type: string): - - **userId** (Type: string): - - **useCases** (Type: string): - - **description** (Type: string): - - **Part 2** (Type: object): - - **author** (Type: object): - - **name**: Display name or email local part (Type: string, nullable): - - Nullable: true - - **id**: User ID of the author (Type: string): - - **hasUserPurchased** (Type: boolean): - - **templatePurchasedId** (Type: string, uuid, nullable): - - Nullable: true - - **status** (Type: string): - - Example: 'success' -` - -// Response Template for the ListMyProjectTemplates tool (Status: 401, Content-Type: application/json) -const ListMyProjectTemplatesResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListMyProjectTemplates tool (Status: 500, Content-Type: application/json) -const ListMyProjectTemplatesResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewListMyProjectTemplatesMCPTool creates the MCP Tool instance for ListMyProjectTemplates -func NewListMyProjectTemplatesMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "ListMyProjectTemplates", - "List my project templates - Returns the authenticated user's project templates (all statuses), paginated.", - []byte(listMyProjectTemplatesInputSchema), - ) -} - -// ListMyProjectTemplatesHandler is the handler function for the ListMyProjectTemplates tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func ListMyProjectTemplatesHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "ListMyProjectTemplates") -} diff --git a/mcptools/ListProjectEnvironments.go b/mcptools/ListProjectEnvironments.go deleted file mode 100644 index ab9e098..0000000 --- a/mcptools/ListProjectEnvironments.go +++ /dev/null @@ -1,221 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the ListProjectEnvironments tool -const listProjectEnvironmentsInputSchema = `{ - "properties": { - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id" - ], - "type": "object" -}` - -// Response Template for the ListProjectEnvironments tool (Status: 200, Content-Type: application/json) -const ListProjectEnvironmentsResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Environments retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: array): - - **Items** (Type: object): - - **status** (Type: string): - - Enum: ['active', 'updating', 'promoting', 'resizing', 'deleting'] - - **branch** (Type: string): - - **displayName**: Display name for the environment (Type: string): - - **resources** (Type: object): - - **extra**: Additional deployment information (URLs, etc.) (Type: object): - - **Additional Properties**: - - **property value** (Type: string): - - **id** (Type: string, uuid): - - **uniqueName** (Type: string): - - **projectDeploymentId** (Type: string, uuid, nullable): - - Nullable: true - - **settings** (Type: object): - - **createdAt** (Type: string, date-time): - - **projectId** (Type: string, uuid): - - **updatedAt** (Type: string, date-time): - - **description** (Type: string): - - **isAutoPromoteEnabled** (Type: boolean): - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the ListProjectEnvironments tool (Status: 400, Content-Type: application/json) -const ListProjectEnvironmentsResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListProjectEnvironments tool (Status: 401, Content-Type: application/json) -const ListProjectEnvironmentsResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListProjectEnvironments tool (Status: 403, Content-Type: application/json) -const ListProjectEnvironmentsResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListProjectEnvironments tool (Status: 404, Content-Type: application/json) -const ListProjectEnvironmentsResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListProjectEnvironments tool (Status: 422, Content-Type: application/json) -const ListProjectEnvironmentsResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Unprocessable Entity - project not active - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListProjectEnvironments tool (Status: 500, Content-Type: application/json) -const ListProjectEnvironmentsResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewListProjectEnvironmentsMCPTool creates the MCP Tool instance for ListProjectEnvironments -func NewListProjectEnvironmentsMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "ListProjectEnvironments", - "List project environments - Returns all environments for a project", - []byte(listProjectEnvironmentsInputSchema), - ) -} - -// ListProjectEnvironmentsHandler is the handler function for the ListProjectEnvironments tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func ListProjectEnvironmentsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "ListProjectEnvironments") -} diff --git a/mcptools/ListProjectTemplateCounts.go b/mcptools/ListProjectTemplateCounts.go deleted file mode 100644 index 88ef4a0..0000000 --- a/mcptools/ListProjectTemplateCounts.go +++ /dev/null @@ -1,93 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the ListProjectTemplateCounts tool -const listProjectTemplateCountsInputSchema = `{ - "properties": { - "name": { - "description": "Filter counts by template name search", - "type": "string" - } - }, - "type": "object" -}` - -// Response Template for the ListProjectTemplateCounts tool (Status: 200, Content-Type: application/json) -const ListProjectTemplateCountsResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Total and category counts - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **total**: Total number of published templates (Type: integer): - - **categoryCounts** (Type: array): - - **Items** (Type: object): - - **count** (Type: integer): - - **name** (Type: string): - - **status** (Type: string): - - Example: 'success' -` - -// Response Template for the ListProjectTemplateCounts tool (Status: 500, Content-Type: application/json) -const ListProjectTemplateCountsResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewListProjectTemplateCountsMCPTool creates the MCP Tool instance for ListProjectTemplateCounts -func NewListProjectTemplateCountsMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "ListProjectTemplateCounts", - "List project template counts by category - Returns total count of published templates and per-category counts. Optional name search.", - []byte(listProjectTemplateCountsInputSchema), - ) -} - -// ListProjectTemplateCountsHandler is the handler function for the ListProjectTemplateCounts tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func ListProjectTemplateCountsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "ListProjectTemplateCounts") -} diff --git a/mcptools/ListProjectTemplatePurchases.go b/mcptools/ListProjectTemplatePurchases.go deleted file mode 100644 index c9b8bbe..0000000 --- a/mcptools/ListProjectTemplatePurchases.go +++ /dev/null @@ -1,156 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the ListProjectTemplatePurchases tool -const listProjectTemplatePurchasesInputSchema = `{ - "properties": { - "limit": { - "default": 10, - "maximum": 50, - "minimum": 1, - "type": "integer" - }, - "offset": { - "default": 0, - "minimum": 0, - "type": "integer" - } - }, - "type": "object" -}` - -// Response Template for the ListProjectTemplatePurchases tool (Status: 200, Content-Type: application/json) -const ListProjectTemplatePurchasesResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> List of purchases with template info - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **purchases** (Type: array): - - **Items** (Type: object): - - **projectTemplateId** (Type: string, uuid): - - **purchasedAmount** (Type: number): - - **template**: Project template model (Type: object): - - **categories** (Type: array): - - **Items** (Type: string): - - **id** (Type: string, uuid): - - **buildResources** (Type: object): - - **name** (Type: string): - - **userId** (Type: string): - - **useCases** (Type: string): - - **description** (Type: string): - - **imageUri** (Type: string): - - **updatedAt** (Type: string, date-time): - - **environmentId** (Type: string, uuid): - - **status** (Type: string): - - Enum: ['draft', 'underReview', 'publishing', 'listed', 'rejected', 'deleted'] - - **overview** (Type: string): - - **projectId** (Type: string, uuid): - - **amount** (Type: number): - - **deploymentResources** (Type: object): - - **videoUrl** (Type: string): - - **createdAt** (Type: string, date-time): - - **projectConfiguration** (Type: object): - - **environmentConfiguration** (Type: object): - - **updatedAt** (Type: string, date-time): - - **userId** (Type: string): - - **createdAt** (Type: string, date-time): - - **id** (Type: string, uuid): - - **pagination** (Type: object): - - **count**: Number of items in the current page (Type: integer): - - Example: '10' - - **limit**: Maximum number of items per page (Type: integer): - - Example: '10' - - **offset**: Number of items skipped (Type: integer): - - Example: '0' - - **total**: Total number of items available (Type: integer): - - Example: '100' - - **status** (Type: string): - - Example: 'success' -` - -// Response Template for the ListProjectTemplatePurchases tool (Status: 401, Content-Type: application/json) -const ListProjectTemplatePurchasesResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListProjectTemplatePurchases tool (Status: 500, Content-Type: application/json) -const ListProjectTemplatePurchasesResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewListProjectTemplatePurchasesMCPTool creates the MCP Tool instance for ListProjectTemplatePurchases -func NewListProjectTemplatePurchasesMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "ListProjectTemplatePurchases", - "List project template purchases - Returns the authenticated user's project template purchases (paginated).", - []byte(listProjectTemplatePurchasesInputSchema), - ) -} - -// ListProjectTemplatePurchasesHandler is the handler function for the ListProjectTemplatePurchases tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func ListProjectTemplatePurchasesHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "ListProjectTemplatePurchases") -} diff --git a/mcptools/ListProjectTemplateRejections.go b/mcptools/ListProjectTemplateRejections.go deleted file mode 100644 index 135c864..0000000 --- a/mcptools/ListProjectTemplateRejections.go +++ /dev/null @@ -1,164 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the ListProjectTemplateRejections tool -const listProjectTemplateRejectionsInputSchema = `{ - "properties": { - "template_id": { - "format": "uuid", - "type": "string" - } - }, - "required": [ - "template_id" - ], - "type": "object" -}` - -// Response Template for the ListProjectTemplateRejections tool (Status: 200, Content-Type: application/json) -const ListProjectTemplateRejectionsResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> List of rejections - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **rejections** (Type: array): - - **Items** (Type: object): - - **id** (Type: integer): - - **projectTemplateId** (Type: string, uuid): - - **rejectionReason** (Type: string): - - **updatedAt** (Type: string, date-time): - - **createdAt** (Type: string, date-time): - - **status** (Type: string): - - Example: 'success' -` - -// Response Template for the ListProjectTemplateRejections tool (Status: 400, Content-Type: application/json) -const ListProjectTemplateRejectionsResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the ListProjectTemplateRejections tool (Status: 401, Content-Type: application/json) -const ListProjectTemplateRejectionsResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the ListProjectTemplateRejections tool (Status: 404, Content-Type: application/json) -const ListProjectTemplateRejectionsResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the ListProjectTemplateRejections tool (Status: 500, Content-Type: application/json) -const ListProjectTemplateRejectionsResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// NewListProjectTemplateRejectionsMCPTool creates the MCP Tool instance for ListProjectTemplateRejections -func NewListProjectTemplateRejectionsMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "ListProjectTemplateRejections", - "List project template rejections - Returns rejection history for the template. Only the template owner can list rejections.", - []byte(listProjectTemplateRejectionsInputSchema), - ) -} - -// ListProjectTemplateRejectionsHandler is the handler function for the ListProjectTemplateRejections tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func ListProjectTemplateRejectionsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "ListProjectTemplateRejections") -} diff --git a/mcptools/ListProjectTransferHistory.go b/mcptools/ListProjectTransferHistory.go deleted file mode 100644 index def35ef..0000000 --- a/mcptools/ListProjectTransferHistory.go +++ /dev/null @@ -1,191 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the ListProjectTransferHistory tool -const listProjectTransferHistoryInputSchema = `{ - "properties": { - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id" - ], - "type": "object" -}` - -// Response Template for the ListProjectTransferHistory tool (Status: 200, Content-Type: application/json) -const ListProjectTransferHistoryResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Transfer history retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: array): - - **Items** (Type: object): - - **fromUserId**: User ID of the previous owner (Type: string): - - Example: 'user_abc123' - - **id**: Unique identifier of the transfer record (Type: string, uuid): - - Example: '550e8400-e29b-41d4-a716-446655440001' - - **projectId**: Project ID that was transferred (Type: string, uuid): - - Example: '550e8400-e29b-41d4-a716-446655440000' - - **toUserId**: User ID of the new owner (Type: string): - - Example: 'user_xyz789' - - **updatedAt**: Last update time of the record (Type: string, date-time): - - **createdAt**: When the transfer occurred (Type: string, date-time): - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the ListProjectTransferHistory tool (Status: 400, Content-Type: application/json) -const ListProjectTransferHistoryResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListProjectTransferHistory tool (Status: 401, Content-Type: application/json) -const ListProjectTransferHistoryResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the ListProjectTransferHistory tool (Status: 403, Content-Type: application/json) -const ListProjectTransferHistoryResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListProjectTransferHistory tool (Status: 404, Content-Type: application/json) -const ListProjectTransferHistoryResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListProjectTransferHistory tool (Status: 500, Content-Type: application/json) -const ListProjectTransferHistoryResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// NewListProjectTransferHistoryMCPTool creates the MCP Tool instance for ListProjectTransferHistory -func NewListProjectTransferHistoryMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "ListProjectTransferHistory", - "List project transfer history - Returns the transfer history of a project, showing all ownership transfers that have occurred.", - []byte(listProjectTransferHistoryInputSchema), - ) -} - -// ListProjectTransferHistoryHandler is the handler function for the ListProjectTransferHistory tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func ListProjectTransferHistoryHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "ListProjectTransferHistory") -} diff --git a/mcptools/ListProjects.go b/mcptools/ListProjects.go deleted file mode 100644 index af6a74f..0000000 --- a/mcptools/ListProjects.go +++ /dev/null @@ -1,222 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the ListProjects tool -const listProjectsInputSchema = `{ - "properties": { - "app": { - "description": "Filter by app ID. Use 'null' to filter projects not assigned to any app", - "type": "string" - }, - "limit": { - "default": 10, - "description": "Maximum number of projects to return (default: 10, max: 20)", - "maximum": 20, - "minimum": 1, - "type": "integer" - }, - "name": { - "description": "Filter by project name (partial match, max 100 characters)", - "maxLength": 100, - "type": "string" - }, - "offset": { - "default": 0, - "description": "Number of projects to skip (default: 0)", - "minimum": 0, - "type": "integer" - }, - "status": { - "description": "Filter by project status. Defaults to active and deleting (excludes deleted)", - "enum": [ - "active", - "deleting", - "deleted" - ], - "type": "string" - }, - "type": { - "description": "Filter by project type", - "enum": [ - "vcs", - "image", - "upload" - ], - "type": "string" - } - }, - "type": "object" -}` - -// Response Template for the ListProjects tool (Status: 200, Content-Type: application/json) -const ListProjectsResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> List of projects retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **data** (Type: array): - - **Items** (Type: object): - - **createdAt** (Type: string, date-time): - - **expireAt**: Expiration time for temporary projects (e.g., GPT-created projects) (Type: string, date-time, nullable): - - Nullable: true - - **source** (Type: object): - - **appId**: App ID the project is associated with (Type: string, uuid, nullable): - - Nullable: true - - **uniqueName** (Type: string): - - **type** (Type: string): - - Enum: ['vcs', 'image', 'upload'] - - **userId** (Type: string): - - **settings**: Project settings (schema depends on project type) (Type: object): - - **id** (Type: string, uuid): - - **status** (Type: string): - - Enum: ['active', 'deleting', 'deleted'] - - **displayName** (Type: string): - - **enabledSecurityScan**: Whether security scanning is enabled for the project (Type: boolean): - - **updatedAt** (Type: string, date-time): - - **deletedAt** (Type: string, date-time, nullable): - - Nullable: true - - **description** (Type: string, nullable): - - Nullable: true - - **pagination** (Type: object): - - **offset**: Number of items skipped (Type: integer): - - Example: '0' - - **total**: Total number of items available (Type: integer): - - Example: '100' - - **count**: Number of items in the current page (Type: integer): - - Example: '10' - - **limit**: Maximum number of items per page (Type: integer): - - Example: '10' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the ListProjects tool (Status: 400, Content-Type: application/json) -const ListProjectsResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - invalid status or type filter - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListProjects tool (Status: 401, Content-Type: application/json) -const ListProjectsResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListProjects tool (Status: 403, Content-Type: application/json) -const ListProjectsResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user cannot list projects - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListProjects tool (Status: 500, Content-Type: application/json) -const ListProjectsResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewListProjectsMCPTool creates the MCP Tool instance for ListProjects -func NewListProjectsMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "ListProjects", - "List all projects - Returns a list of all projects for the authenticated user", - []byte(listProjectsInputSchema), - ) -} - -// ListProjectsHandler is the handler function for the ListProjects tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func ListProjectsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "ListProjects") -} diff --git a/mcptools/ListProjectsByApp.go b/mcptools/ListProjectsByApp.go deleted file mode 100644 index 1b5c9b9..0000000 --- a/mcptools/ListProjectsByApp.go +++ /dev/null @@ -1,225 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the ListProjectsByApp tool -const listProjectsByAppInputSchema = `{ - "properties": { - "app_id": { - "description": "App unique identifier", - "format": "uuid", - "type": "string" - }, - "limit": { - "default": 10, - "description": "Maximum number of projects to return (default: 10, max: 20)", - "maximum": 20, - "minimum": 1, - "type": "integer" - }, - "offset": { - "default": 0, - "description": "Number of projects to skip (default: 0)", - "minimum": 0, - "type": "integer" - } - }, - "required": [ - "app_id" - ], - "type": "object" -}` - -// Response Template for the ListProjectsByApp tool (Status: 200, Content-Type: application/json) -const ListProjectsByAppResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Projects retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **data** (Type: array): - - **Items** (Type: object): - - **createdAt** (Type: string, date-time): - - **expireAt**: Expiration time for temporary projects (e.g., GPT-created projects) (Type: string, date-time, nullable): - - Nullable: true - - **source** (Type: object): - - **appId**: App ID the project is associated with (Type: string, uuid, nullable): - - Nullable: true - - **uniqueName** (Type: string): - - **type** (Type: string): - - Enum: ['vcs', 'image', 'upload'] - - **userId** (Type: string): - - **settings**: Project settings (schema depends on project type) (Type: object): - - **id** (Type: string, uuid): - - **status** (Type: string): - - Enum: ['active', 'deleting', 'deleted'] - - **displayName** (Type: string): - - **enabledSecurityScan**: Whether security scanning is enabled for the project (Type: boolean): - - **updatedAt** (Type: string, date-time): - - **deletedAt** (Type: string, date-time, nullable): - - Nullable: true - - **description** (Type: string, nullable): - - Nullable: true - - **pagination** (Type: object): - - **count**: Number of items in the current page (Type: integer): - - Example: '10' - - **limit**: Maximum number of items per page (Type: integer): - - Example: '10' - - **offset**: Number of items skipped (Type: integer): - - Example: '0' - - **total**: Total number of items available (Type: integer): - - Example: '100' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the ListProjectsByApp tool (Status: 400, Content-Type: application/json) -const ListProjectsByAppResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListProjectsByApp tool (Status: 401, Content-Type: application/json) -const ListProjectsByAppResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListProjectsByApp tool (Status: 403, Content-Type: application/json) -const ListProjectsByAppResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListProjectsByApp tool (Status: 404, Content-Type: application/json) -const ListProjectsByAppResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListProjectsByApp tool (Status: 500, Content-Type: application/json) -const ListProjectsByAppResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewListProjectsByAppMCPTool creates the MCP Tool instance for ListProjectsByApp -func NewListProjectsByAppMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "ListProjectsByApp", - "List projects by app - Returns all projects associated with an app", - []byte(listProjectsByAppInputSchema), - ) -} - -// ListProjectsByAppHandler is the handler function for the ListProjectsByApp tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func ListProjectsByAppHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "ListProjectsByApp") -} diff --git a/mcptools/ListPublishedProjectTemplates.go b/mcptools/ListPublishedProjectTemplates.go deleted file mode 100644 index 48656b8..0000000 --- a/mcptools/ListPublishedProjectTemplates.go +++ /dev/null @@ -1,147 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the ListPublishedProjectTemplates tool -const listPublishedProjectTemplatesInputSchema = `{ - "properties": { - "categories": { - "description": "Comma-separated category names to filter by", - "type": "string" - }, - "limit": { - "default": 10, - "description": "Maximum number of templates to return (default 10, max 20)", - "maximum": 20, - "minimum": 1, - "type": "integer" - }, - "name": { - "description": "Search by template name", - "type": "string" - }, - "offset": { - "default": 0, - "description": "Number of templates to skip (default 0)", - "minimum": 0, - "type": "integer" - } - }, - "type": "object" -}` - -// Response Template for the ListPublishedProjectTemplates tool (Status: 200, Content-Type: application/json) -const ListPublishedProjectTemplatesResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> List of published project templates - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **templates** (Type: array): - - **Items** (Type: object): - - **Combines All Of the following structures**: - - **Part 1**: Project template model (Type: object): - - **environmentConfiguration** (Type: object): - - **createdAt** (Type: string, date-time): - - **projectConfiguration** (Type: object): - - **imageUri** (Type: string): - - **categories** (Type: array): - - **Items** (Type: string): - - **id** (Type: string, uuid): - - **buildResources** (Type: object): - - **name** (Type: string): - - **userId** (Type: string): - - **useCases** (Type: string): - - **description** (Type: string): - - **projectId** (Type: string, uuid): - - **updatedAt** (Type: string, date-time): - - **environmentId** (Type: string, uuid): - - **status** (Type: string): - - Enum: ['draft', 'underReview', 'publishing', 'listed', 'rejected', 'deleted'] - - **overview** (Type: string): - - **videoUrl** (Type: string): - - **amount** (Type: number): - - **deploymentResources** (Type: object): - - **Part 2** (Type: object): - - **hasUserPurchased** (Type: boolean): - - **templatePurchasedId** (Type: string, uuid, nullable): - - Nullable: true - - **author** (Type: object): - - **id**: User ID of the author (Type: string): - - **name**: Display name or email local part (Type: string, nullable): - - Nullable: true - - **pagination** (Type: object): - - **total**: Total number of items available (Type: integer): - - Example: '100' - - **count**: Number of items in the current page (Type: integer): - - Example: '10' - - **limit**: Maximum number of items per page (Type: integer): - - Example: '10' - - **offset**: Number of items skipped (Type: integer): - - Example: '0' - - **status** (Type: string): - - Example: 'success' -` - -// Response Template for the ListPublishedProjectTemplates tool (Status: 500, Content-Type: application/json) -const ListPublishedProjectTemplatesResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewListPublishedProjectTemplatesMCPTool creates the MCP Tool instance for ListPublishedProjectTemplates -func NewListPublishedProjectTemplatesMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "ListPublishedProjectTemplates", - "List published project templates - Returns a paginated list of published (listed) project templates. Optional auth; when authenticated, includes whether the user has purchased each template. Can filter by categories (comma-separated) and search by name.", - []byte(listPublishedProjectTemplatesInputSchema), - ) -} - -// ListPublishedProjectTemplatesHandler is the handler function for the ListPublishedProjectTemplates tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func ListPublishedProjectTemplatesHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "ListPublishedProjectTemplates") -} diff --git a/mcptools/ListServicesByApp.go b/mcptools/ListServicesByApp.go deleted file mode 100644 index 33710bf..0000000 --- a/mcptools/ListServicesByApp.go +++ /dev/null @@ -1,204 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the ListServicesByApp tool -const listServicesByAppInputSchema = `{ - "properties": { - "app_id": { - "description": "App unique identifier", - "format": "uuid", - "type": "string" - }, - "limit": { - "default": 10, - "description": "Maximum number of services to return (default: 10, max: 20)", - "maximum": 20, - "minimum": 1, - "type": "integer" - }, - "offset": { - "default": 0, - "description": "Number of services to skip (default: 0)", - "minimum": 0, - "type": "integer" - } - }, - "required": [ - "app_id" - ], - "type": "object" -}` - -// Response Template for the ListServicesByApp tool (Status: 200, Content-Type: application/json) -const ListServicesByAppResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Services retrieved successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **data** (Type: array): - - **Items**: Service instance with optional plan information (Type: object): - - **pagination** (Type: object): - - **count**: Number of items in the current page (Type: integer): - - Example: '10' - - **limit**: Maximum number of items per page (Type: integer): - - Example: '10' - - **offset**: Number of items skipped (Type: integer): - - Example: '0' - - **total**: Total number of items available (Type: integer): - - Example: '100' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the ListServicesByApp tool (Status: 400, Content-Type: application/json) -const ListServicesByAppResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListServicesByApp tool (Status: 401, Content-Type: application/json) -const ListServicesByAppResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListServicesByApp tool (Status: 403, Content-Type: application/json) -const ListServicesByAppResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the ListServicesByApp tool (Status: 404, Content-Type: application/json) -const ListServicesByAppResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the ListServicesByApp tool (Status: 500, Content-Type: application/json) -const ListServicesByAppResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewListServicesByAppMCPTool creates the MCP Tool instance for ListServicesByApp -func NewListServicesByAppMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "ListServicesByApp", - "List services by app - Returns all services associated with an app", - []byte(listServicesByAppInputSchema), - ) -} - -// ListServicesByAppHandler is the handler function for the ListServicesByApp tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func ListServicesByAppHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "ListServicesByApp") -} diff --git a/mcptools/RefreshDomain.go b/mcptools/RefreshDomain.go deleted file mode 100644 index 6f2a78e..0000000 --- a/mcptools/RefreshDomain.go +++ /dev/null @@ -1,209 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the RefreshDomain tool -const refreshDomainInputSchema = `{ - "properties": { - "domain_id": { - "description": "Domain unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "domain_id" - ], - "type": "object" -}` - -// Response Template for the RefreshDomain tool (Status: 200, Content-Type: application/json) -const RefreshDomainResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Domain refresh initiated successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'domain is being refreshed' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the RefreshDomain tool (Status: 400, Content-Type: application/json) -const RefreshDomainResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the RefreshDomain tool (Status: 401, Content-Type: application/json) -const RefreshDomainResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the RefreshDomain tool (Status: 403, Content-Type: application/json) -const RefreshDomainResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the RefreshDomain tool (Status: 404, Content-Type: application/json) -const RefreshDomainResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the RefreshDomain tool (Status: 422, Content-Type: application/json) -const RefreshDomainResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Unprocessable Entity - domain not in eligible state or project not active - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the RefreshDomain tool (Status: 500, Content-Type: application/json) -const RefreshDomainResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewRefreshDomainMCPTool creates the MCP Tool instance for RefreshDomain -func NewRefreshDomainMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "RefreshDomain", - "Refresh domain - Triggers a refresh of the domain verification. Only available for domains in pending status.", - []byte(refreshDomainInputSchema), - ) -} - -// RefreshDomainHandler is the handler function for the RefreshDomain tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func RefreshDomainHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "RefreshDomain") -} diff --git a/mcptools/RemoveProjectsFromApp.go b/mcptools/RemoveProjectsFromApp.go deleted file mode 100644 index 31d6546..0000000 --- a/mcptools/RemoveProjectsFromApp.go +++ /dev/null @@ -1,202 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the RemoveProjectsFromApp tool -const removeProjectsFromAppInputSchema = `{ - "properties": { - "app_id": { - "description": "App unique identifier", - "format": "uuid", - "type": "string" - }, - "body": { - "properties": { - "projectIds": { - "description": "List of project IDs to add to or remove from the app", - "example": [ - "550e8400-e29b-41d4-a716-446655440000", - "550e8400-e29b-41d4-a716-446655440001" - ], - "items": { - "format": "uuid", - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "projectIds" - ], - "type": "object" - } - }, - "required": [ - "app_id", - "body" - ], - "type": "object" -}` - -// Response Template for the RemoveProjectsFromApp tool (Status: 200, Content-Type: application/json) -const RemoveProjectsFromAppResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Projects removed from app successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'projects removed from app successfully' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the RemoveProjectsFromApp tool (Status: 400, Content-Type: application/json) -const RemoveProjectsFromAppResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - project not associated with this app - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the RemoveProjectsFromApp tool (Status: 401, Content-Type: application/json) -const RemoveProjectsFromAppResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the RemoveProjectsFromApp tool (Status: 403, Content-Type: application/json) -const RemoveProjectsFromAppResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the RemoveProjectsFromApp tool (Status: 404, Content-Type: application/json) -const RemoveProjectsFromAppResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the RemoveProjectsFromApp tool (Status: 500, Content-Type: application/json) -const RemoveProjectsFromAppResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// NewRemoveProjectsFromAppMCPTool creates the MCP Tool instance for RemoveProjectsFromApp -func NewRemoveProjectsFromAppMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "RemoveProjectsFromApp", - "Remove projects from app - Removes one or more projects from an app by setting their app_id to null", - []byte(removeProjectsFromAppInputSchema), - ) -} - -// RemoveProjectsFromAppHandler is the handler function for the RemoveProjectsFromApp tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func RemoveProjectsFromAppHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "RemoveProjectsFromApp") -} diff --git a/mcptools/RemoveServicesFromApp.go b/mcptools/RemoveServicesFromApp.go deleted file mode 100644 index cec2f36..0000000 --- a/mcptools/RemoveServicesFromApp.go +++ /dev/null @@ -1,202 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the RemoveServicesFromApp tool -const removeServicesFromAppInputSchema = `{ - "properties": { - "app_id": { - "description": "App unique identifier", - "format": "uuid", - "type": "string" - }, - "body": { - "properties": { - "serviceIds": { - "description": "List of service IDs to add to or remove from the app", - "example": [ - "550e8400-e29b-41d4-a716-446655440000", - "550e8400-e29b-41d4-a716-446655440001" - ], - "items": { - "format": "uuid", - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "serviceIds" - ], - "type": "object" - } - }, - "required": [ - "app_id", - "body" - ], - "type": "object" -}` - -// Response Template for the RemoveServicesFromApp tool (Status: 200, Content-Type: application/json) -const RemoveServicesFromAppResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Services removed from app successfully - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'true' - - **data** (Type: string): - - Example: 'services removed from app successfully' -` - -// Response Template for the RemoveServicesFromApp tool (Status: 400, Content-Type: application/json) -const RemoveServicesFromAppResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - service not associated with this app - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the RemoveServicesFromApp tool (Status: 401, Content-Type: application/json) -const RemoveServicesFromAppResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the RemoveServicesFromApp tool (Status: 403, Content-Type: application/json) -const RemoveServicesFromAppResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the RemoveServicesFromApp tool (Status: 404, Content-Type: application/json) -const RemoveServicesFromAppResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the RemoveServicesFromApp tool (Status: 500, Content-Type: application/json) -const RemoveServicesFromAppResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewRemoveServicesFromAppMCPTool creates the MCP Tool instance for RemoveServicesFromApp -func NewRemoveServicesFromAppMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "RemoveServicesFromApp", - "Remove services from app - Removes one or more services from an app by setting their app_id to null", - []byte(removeServicesFromAppInputSchema), - ) -} - -// RemoveServicesFromAppHandler is the handler function for the RemoveServicesFromApp tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func RemoveServicesFromAppHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "RemoveServicesFromApp") -} diff --git a/mcptools/RetriggerDeployment.go b/mcptools/RetriggerDeployment.go deleted file mode 100644 index a1320fb..0000000 --- a/mcptools/RetriggerDeployment.go +++ /dev/null @@ -1,218 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the RetriggerDeployment tool -const retriggerDeploymentInputSchema = `{ - "properties": { - "deployment_id": { - "description": "Deployment unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - }, - "settings": { - "default": "deployment", - "description": "Which settings to use for the new deployment. \"project\": Use current project settings. \"deployment\": Use settings from the original deployment (default).", - "enum": [ - "project", - "deployment" - ], - "type": "string" - } - }, - "required": [ - "project_id", - "deployment_id" - ], - "type": "object" -}` - -// Response Template for the RetriggerDeployment tool (Status: 200, Content-Type: application/json) -const RetriggerDeploymentResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Deployment triggered successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'deployment triggered' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the RetriggerDeployment tool (Status: 400, Content-Type: application/json) -const RetriggerDeploymentResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the RetriggerDeployment tool (Status: 401, Content-Type: application/json) -const RetriggerDeploymentResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the RetriggerDeployment tool (Status: 403, Content-Type: application/json) -const RetriggerDeploymentResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the RetriggerDeployment tool (Status: 404, Content-Type: application/json) -const RetriggerDeploymentResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the RetriggerDeployment tool (Status: 422, Content-Type: application/json) -const RetriggerDeploymentResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Unprocessable Entity - project not active - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the RetriggerDeployment tool (Status: 500, Content-Type: application/json) -const RetriggerDeploymentResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// NewRetriggerDeploymentMCPTool creates the MCP Tool instance for RetriggerDeployment -func NewRetriggerDeploymentMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "RetriggerDeployment", - "Retrigger deployment - Creates a new deployment with the same source as an existing deployment. The settings can be taken from either the project (current project settings) or the original deployment (deployment settings) only works when VCS.", - []byte(retriggerDeploymentInputSchema), - ) -} - -// RetriggerDeploymentHandler is the handler function for the RetriggerDeployment tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func RetriggerDeploymentHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "RetriggerDeployment") -} diff --git a/mcptools/RetriggerSecurityScan.go b/mcptools/RetriggerSecurityScan.go deleted file mode 100644 index 29c1baa..0000000 --- a/mcptools/RetriggerSecurityScan.go +++ /dev/null @@ -1,187 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the RetriggerSecurityScan tool -const retriggerSecurityScanInputSchema = `{ - "properties": { - "deployment_id": { - "description": "Deployment unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "deployment_id" - ], - "type": "object" -}` - -// Response Template for the RetriggerSecurityScan tool (Status: 200, Content-Type: application/json) -const RetriggerSecurityScanResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Security scan retriggered successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'security scan report retriggered' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the RetriggerSecurityScan tool (Status: 400, Content-Type: application/json) -const RetriggerSecurityScanResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - security scan not enabled or report not in failed status - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the RetriggerSecurityScan tool (Status: 401, Content-Type: application/json) -const RetriggerSecurityScanResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the RetriggerSecurityScan tool (Status: 403, Content-Type: application/json) -const RetriggerSecurityScanResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the RetriggerSecurityScan tool (Status: 404, Content-Type: application/json) -const RetriggerSecurityScanResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the RetriggerSecurityScan tool (Status: 500, Content-Type: application/json) -const RetriggerSecurityScanResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewRetriggerSecurityScanMCPTool creates the MCP Tool instance for RetriggerSecurityScan -func NewRetriggerSecurityScanMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "RetriggerSecurityScan", - "Retrigger security scan - Retriggers a failed security scan. Only available when the scan status is failed.", - []byte(retriggerSecurityScanInputSchema), - ) -} - -// RetriggerSecurityScanHandler is the handler function for the RetriggerSecurityScan tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func RetriggerSecurityScanHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "RetriggerSecurityScan") -} diff --git a/mcptools/RevokeAPIKey.go b/mcptools/RevokeAPIKey.go deleted file mode 100644 index 9db41cf..0000000 --- a/mcptools/RevokeAPIKey.go +++ /dev/null @@ -1,159 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the RevokeAPIKey tool -const revokeAPIKeyInputSchema = `{ - "properties": { - "api_key_id": { - "description": "API key unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "api_key_id" - ], - "type": "object" -}` - -// Response Template for the RevokeAPIKey tool (Status: 200, Content-Type: application/json) -const RevokeAPIKeyResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> API key revoked successfully - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'true' - - **data** (Type: string): - - Example: 'api key revoked successfully' -` - -// Response Template for the RevokeAPIKey tool (Status: 400, Content-Type: application/json) -const RevokeAPIKeyResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the RevokeAPIKey tool (Status: 401, Content-Type: application/json) -const RevokeAPIKeyResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the RevokeAPIKey tool (Status: 404, Content-Type: application/json) -const RevokeAPIKeyResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the RevokeAPIKey tool (Status: 500, Content-Type: application/json) -const RevokeAPIKeyResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewRevokeAPIKeyMCPTool creates the MCP Tool instance for RevokeAPIKey -func NewRevokeAPIKeyMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "RevokeAPIKey", - "Revoke API key - Revokes an API key, making it unusable", - []byte(revokeAPIKeyInputSchema), - ) -} - -// RevokeAPIKeyHandler is the handler function for the RevokeAPIKey tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func RevokeAPIKeyHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "RevokeAPIKey") -} diff --git a/mcptools/SuspendCronjob.go b/mcptools/SuspendCronjob.go deleted file mode 100644 index 167ed25..0000000 --- a/mcptools/SuspendCronjob.go +++ /dev/null @@ -1,187 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the SuspendCronjob tool -const suspendCronjobInputSchema = `{ - "properties": { - "cronjob_id": { - "description": "Cronjob unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "cronjob_id" - ], - "type": "object" -}` - -// Response Template for the SuspendCronjob tool (Status: 200, Content-Type: application/json) -const SuspendCronjobResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Cronjob suspended successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'cronjob suspended' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the SuspendCronjob tool (Status: 401, Content-Type: application/json) -const SuspendCronjobResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the SuspendCronjob tool (Status: 403, Content-Type: application/json) -const SuspendCronjobResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the SuspendCronjob tool (Status: 404, Content-Type: application/json) -const SuspendCronjobResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the SuspendCronjob tool (Status: 422, Content-Type: application/json) -const SuspendCronjobResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Unprocessable Entity - cronjob is already suspended - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the SuspendCronjob tool (Status: 500, Content-Type: application/json) -const SuspendCronjobResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewSuspendCronjobMCPTool creates the MCP Tool instance for SuspendCronjob -func NewSuspendCronjobMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "SuspendCronjob", - "Suspend a cronjob - Suspends a cronjob, pausing its scheduled executions.", - []byte(suspendCronjobInputSchema), - ) -} - -// SuspendCronjobHandler is the handler function for the SuspendCronjob tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func SuspendCronjobHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "SuspendCronjob") -} diff --git a/mcptools/TransferProject.go b/mcptools/TransferProject.go deleted file mode 100644 index fe484ca..0000000 --- a/mcptools/TransferProject.go +++ /dev/null @@ -1,208 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the TransferProject tool -const transferProjectInputSchema = `{ - "properties": { - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - }, - "token": { - "description": "Transfer token obtained from the transfer-uri endpoint", - "type": "string" - } - }, - "required": [ - "project_id", - "token" - ], - "type": "object" -}` - -// Response Template for the TransferProject tool (Status: 200, Content-Type: application/json) -const TransferProjectResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Project transferred successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'project transferred successfully' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the TransferProject tool (Status: 400, Content-Type: application/json) -const TransferProjectResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - invalid project ID or missing token - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the TransferProject tool (Status: 401, Content-Type: application/json) -const TransferProjectResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - invalid or expired token - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the TransferProject tool (Status: 403, Content-Type: application/json) -const TransferProjectResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - token does not match project or owner - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the TransferProject tool (Status: 404, Content-Type: application/json) -const TransferProjectResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the TransferProject tool (Status: 429, Content-Type: application/json) -const TransferProjectResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 429 - -**Content-Type:** application/json - -> Too many requests - maximum projects per user reached - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the TransferProject tool (Status: 500, Content-Type: application/json) -const TransferProjectResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewTransferProjectMCPTool creates the MCP Tool instance for TransferProject -func NewTransferProjectMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "TransferProject", - "Transfer project ownership - Transfers project ownership to the authenticated user using a valid transfer token. The token must be obtained from the transfer-uri endpoint by the current project owner.", - []byte(transferProjectInputSchema), - ) -} - -// TransferProjectHandler is the handler function for the TransferProject tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func TransferProjectHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "TransferProject") -} diff --git a/mcptools/TriggerLatestDeployment.go b/mcptools/TriggerLatestDeployment.go deleted file mode 100644 index 468f9e4..0000000 --- a/mcptools/TriggerLatestDeployment.go +++ /dev/null @@ -1,190 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the TriggerLatestDeployment tool -const triggerLatestDeploymentInputSchema = `{ - "properties": { - "branch": { - "description": "Branch name to deploy from. Defaults to the repository's default branch if not specified.", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id" - ], - "type": "object" -}` - -// Response Template for the TriggerLatestDeployment tool (Status: 200, Content-Type: application/json) -const TriggerLatestDeploymentResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Deployment triggered successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: Combinator): - - **One Of the following structures**: - - **Option 1**: Message when deployment was already triggered for this commit (Type: string): - - Example: 'deployment already triggered' - - **Option 2**: New deployment created (Type: object): - - **id**: ID of the created deployment (Type: string, uuid): - - Example: '550e8400-e29b-41d4-a716-446655440000' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the TriggerLatestDeployment tool (Status: 400, Content-Type: application/json) -const TriggerLatestDeploymentResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - project not active, not a VCS project, or branch doesn't exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the TriggerLatestDeployment tool (Status: 401, Content-Type: application/json) -const TriggerLatestDeploymentResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the TriggerLatestDeployment tool (Status: 403, Content-Type: application/json) -const TriggerLatestDeploymentResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the TriggerLatestDeployment tool (Status: 404, Content-Type: application/json) -const TriggerLatestDeploymentResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the TriggerLatestDeployment tool (Status: 500, Content-Type: application/json) -const TriggerLatestDeploymentResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewTriggerLatestDeploymentMCPTool creates the MCP Tool instance for TriggerLatestDeployment -func NewTriggerLatestDeploymentMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "TriggerLatestDeployment", - "Trigger latest deployment - Triggers a new deployment for the latest commit on the specified branch (or default branch if not specified). Only available for VCS projects.", - []byte(triggerLatestDeploymentInputSchema), - ) -} - -// TriggerLatestDeploymentHandler is the handler function for the TriggerLatestDeployment tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func TriggerLatestDeploymentHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "TriggerLatestDeployment") -} diff --git a/mcptools/TriggerSecurityScan.go b/mcptools/TriggerSecurityScan.go deleted file mode 100644 index 9899b89..0000000 --- a/mcptools/TriggerSecurityScan.go +++ /dev/null @@ -1,187 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the TriggerSecurityScan tool -const triggerSecurityScanInputSchema = `{ - "properties": { - "deployment_id": { - "description": "Deployment unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "deployment_id" - ], - "type": "object" -}` - -// Response Template for the TriggerSecurityScan tool (Status: 200, Content-Type: application/json) -const TriggerSecurityScanResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Security scan triggered successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'security scan report created and triggered' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the TriggerSecurityScan tool (Status: 400, Content-Type: application/json) -const TriggerSecurityScanResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - security scan not enabled for project - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the TriggerSecurityScan tool (Status: 401, Content-Type: application/json) -const TriggerSecurityScanResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the TriggerSecurityScan tool (Status: 403, Content-Type: application/json) -const TriggerSecurityScanResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the TriggerSecurityScan tool (Status: 404, Content-Type: application/json) -const TriggerSecurityScanResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the TriggerSecurityScan tool (Status: 500, Content-Type: application/json) -const TriggerSecurityScanResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewTriggerSecurityScanMCPTool creates the MCP Tool instance for TriggerSecurityScan -func NewTriggerSecurityScanMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "TriggerSecurityScan", - "Trigger security scan - Creates and triggers a new security scan for a deployment. Security scanning must be enabled for the project.", - []byte(triggerSecurityScanInputSchema), - ) -} - -// TriggerSecurityScanHandler is the handler function for the TriggerSecurityScan tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func TriggerSecurityScanHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "TriggerSecurityScan") -} diff --git a/mcptools/UnsuspendCronjob.go b/mcptools/UnsuspendCronjob.go deleted file mode 100644 index 75bcbff..0000000 --- a/mcptools/UnsuspendCronjob.go +++ /dev/null @@ -1,187 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the UnsuspendCronjob tool -const unsuspendCronjobInputSchema = `{ - "properties": { - "cronjob_id": { - "description": "Cronjob unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "cronjob_id" - ], - "type": "object" -}` - -// Response Template for the UnsuspendCronjob tool (Status: 200, Content-Type: application/json) -const UnsuspendCronjobResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Cronjob unsuspended successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'cronjob unsuspended' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the UnsuspendCronjob tool (Status: 401, Content-Type: application/json) -const UnsuspendCronjobResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UnsuspendCronjob tool (Status: 403, Content-Type: application/json) -const UnsuspendCronjobResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UnsuspendCronjob tool (Status: 404, Content-Type: application/json) -const UnsuspendCronjobResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UnsuspendCronjob tool (Status: 422, Content-Type: application/json) -const UnsuspendCronjobResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Unprocessable Entity - cronjob is not suspended - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UnsuspendCronjob tool (Status: 500, Content-Type: application/json) -const UnsuspendCronjobResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewUnsuspendCronjobMCPTool creates the MCP Tool instance for UnsuspendCronjob -func NewUnsuspendCronjobMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "UnsuspendCronjob", - "Unsuspend a cronjob - Resumes a suspended cronjob, restarting its scheduled executions.", - []byte(unsuspendCronjobInputSchema), - ) -} - -// UnsuspendCronjobHandler is the handler function for the UnsuspendCronjob tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func UnsuspendCronjobHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "UnsuspendCronjob") -} diff --git a/mcptools/UpdateAPIKey.go b/mcptools/UpdateAPIKey.go deleted file mode 100644 index 2b93776..0000000 --- a/mcptools/UpdateAPIKey.go +++ /dev/null @@ -1,185 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the UpdateAPIKey tool -const updateAPIKeyInputSchema = `{ - "properties": { - "api_key_id": { - "description": "API key unique identifier", - "format": "uuid", - "type": "string" - }, - "body": { - "properties": { - "description": { - "example": "Updated API key description", - "maxLength": 2048, - "minLength": 4, - "pattern": "^[a-zA-Z0-9 _-]+$", - "type": [ - "string", - "null" - ] - }, - "name": { - "example": "updated-api-key", - "maxLength": 48, - "minLength": 4, - "pattern": "^[a-zA-Z0-9-]+$", - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - } - }, - "required": [ - "api_key_id", - "body" - ], - "type": "object" -}` - -// Response Template for the UpdateAPIKey tool (Status: 200, Content-Type: application/json) -const UpdateAPIKeyResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> API key updated successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'api key updated successfully' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the UpdateAPIKey tool (Status: 400, Content-Type: application/json) -const UpdateAPIKeyResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the UpdateAPIKey tool (Status: 401, Content-Type: application/json) -const UpdateAPIKeyResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the UpdateAPIKey tool (Status: 404, Content-Type: application/json) -const UpdateAPIKeyResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateAPIKey tool (Status: 500, Content-Type: application/json) -const UpdateAPIKeyResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewUpdateAPIKeyMCPTool creates the MCP Tool instance for UpdateAPIKey -func NewUpdateAPIKeyMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "UpdateAPIKey", - "Update API key - Updates the name and description of an API key", - []byte(updateAPIKeyInputSchema), - ) -} - -// UpdateAPIKeyHandler is the handler function for the UpdateAPIKey tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func UpdateAPIKeyHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "UpdateAPIKey") -} diff --git a/mcptools/UpdateApp.go b/mcptools/UpdateApp.go deleted file mode 100644 index 60723fc..0000000 --- a/mcptools/UpdateApp.go +++ /dev/null @@ -1,213 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the UpdateApp tool -const updateAppInputSchema = `{ - "properties": { - "app_id": { - "description": "App unique identifier", - "format": "uuid", - "type": "string" - }, - "body": { - "properties": { - "color": { - "description": "Hex color code for the app", - "example": "#3B82F6", - "pattern": "^#[0-9A-Fa-f]{6}$", - "type": "string" - }, - "description": { - "description": "Description of the app", - "example": "Updated description", - "maxLength": 2048, - "minLength": 1, - "type": [ - "string", - "null" - ] - }, - "name": { - "description": "Name of the app", - "example": "My Updated Application", - "maxLength": 255, - "minLength": 1, - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - } - }, - "required": [ - "app_id", - "body" - ], - "type": "object" -}` - -// Response Template for the UpdateApp tool (Status: 200, Content-Type: application/json) -const UpdateAppResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> App updated successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'app updated successfully' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the UpdateApp tool (Status: 400, Content-Type: application/json) -const UpdateAppResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateApp tool (Status: 401, Content-Type: application/json) -const UpdateAppResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateApp tool (Status: 403, Content-Type: application/json) -const UpdateAppResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateApp tool (Status: 404, Content-Type: application/json) -const UpdateAppResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateApp tool (Status: 500, Content-Type: application/json) -const UpdateAppResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewUpdateAppMCPTool creates the MCP Tool instance for UpdateApp -func NewUpdateAppMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "UpdateApp", - "Update app - Updates an app's name, description, and color", - []byte(updateAppInputSchema), - ) -} - -// UpdateAppHandler is the handler function for the UpdateApp tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func UpdateAppHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "UpdateApp") -} diff --git a/mcptools/UpdateCronjob.go b/mcptools/UpdateCronjob.go deleted file mode 100644 index a50f1fa..0000000 --- a/mcptools/UpdateCronjob.go +++ /dev/null @@ -1,268 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the UpdateCronjob tool -const updateCronjobInputSchema = `{ - "properties": { - "body": { - "properties": { - "name": { - "description": "Name of the cronjob", - "example": "health-check-updated", - "maxLength": 255, - "minLength": 1, - "type": "string" - }, - "schedule": { - "description": "Cron schedule expression", - "example": "0 * * * *", - "maxLength": 256, - "type": "string" - }, - "settings": { - "description": "Cronjob type-specific settings", - "oneOf": [ - { - "properties": { - "body": { - "description": "Request body", - "maxLength": 65536, - "type": [ - "string", - "null" - ] - }, - "headers": { - "additionalProperties": { - "type": "string" - }, - "description": "HTTP headers to include in the request", - "example": { - "Authorization": "Bearer token" - }, - "type": "object" - }, - "method": { - "description": "HTTP method", - "enum": [ - "GET", - "POST", - "PUT", - "DELETE", - "PATCH", - "HEAD" - ], - "example": "GET", - "type": "string" - }, - "path": { - "description": "Request path (must start with /)", - "example": "/api/health", - "maxLength": 2048, - "type": "string" - }, - "timeoutInSeconds": { - "description": "Request timeout in seconds", - "example": 5, - "maximum": 5, - "minimum": 1, - "type": "integer" - } - }, - "required": [ - "path", - "method" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "schedule" - ], - "type": "object" - }, - "cronjob_id": { - "description": "Cronjob unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "cronjob_id", - "body" - ], - "type": "object" -}` - -// Response Template for the UpdateCronjob tool (Status: 200, Content-Type: application/json) -const UpdateCronjobResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Cronjob updated successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'cronjob updated' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the UpdateCronjob tool (Status: 400, Content-Type: application/json) -const UpdateCronjobResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateCronjob tool (Status: 401, Content-Type: application/json) -const UpdateCronjobResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateCronjob tool (Status: 403, Content-Type: application/json) -const UpdateCronjobResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateCronjob tool (Status: 404, Content-Type: application/json) -const UpdateCronjobResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateCronjob tool (Status: 500, Content-Type: application/json) -const UpdateCronjobResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewUpdateCronjobMCPTool creates the MCP Tool instance for UpdateCronjob -func NewUpdateCronjobMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "UpdateCronjob", - "Update a cronjob - Updates the name, schedule, and settings of a cronjob.", - []byte(updateCronjobInputSchema), - ) -} - -// UpdateCronjobHandler is the handler function for the UpdateCronjob tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func UpdateCronjobHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "UpdateCronjob") -} diff --git a/mcptools/UpdateDomainEnvironment.go b/mcptools/UpdateDomainEnvironment.go deleted file mode 100644 index a719b58..0000000 --- a/mcptools/UpdateDomainEnvironment.go +++ /dev/null @@ -1,224 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the UpdateDomainEnvironment tool -const updateDomainEnvironmentInputSchema = `{ - "properties": { - "body": { - "properties": { - "environmentId": { - "description": "Environment ID to assign the domain to", - "example": "550e8400-e29b-41d4-a716-446655440000", - "format": "uuid", - "type": [ - "string", - "null" - ] - } - }, - "type": "object" - }, - "domain_id": { - "description": "Domain unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "domain_id", - "body" - ], - "type": "object" -}` - -// Response Template for the UpdateDomainEnvironment tool (Status: 200, Content-Type: application/json) -const UpdateDomainEnvironmentResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Domain environment updated successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'domain environment updated successfully' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the UpdateDomainEnvironment tool (Status: 400, Content-Type: application/json) -const UpdateDomainEnvironmentResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateDomainEnvironment tool (Status: 401, Content-Type: application/json) -const UpdateDomainEnvironmentResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateDomainEnvironment tool (Status: 403, Content-Type: application/json) -const UpdateDomainEnvironmentResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateDomainEnvironment tool (Status: 404, Content-Type: application/json) -const UpdateDomainEnvironmentResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateDomainEnvironment tool (Status: 422, Content-Type: application/json) -const UpdateDomainEnvironmentResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Unprocessable Entity - domain not active, project not active, or environment not deployed - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateDomainEnvironment tool (Status: 500, Content-Type: application/json) -const UpdateDomainEnvironmentResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewUpdateDomainEnvironmentMCPTool creates the MCP Tool instance for UpdateDomainEnvironment -func NewUpdateDomainEnvironmentMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "UpdateDomainEnvironment", - "Update domain environment - Updates the environment assignment for a domain. The domain must be in active status.", - []byte(updateDomainEnvironmentInputSchema), - ) -} - -// UpdateDomainEnvironmentHandler is the handler function for the UpdateDomainEnvironment tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func UpdateDomainEnvironmentHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "UpdateDomainEnvironment") -} diff --git a/mcptools/UpdateProject.go b/mcptools/UpdateProject.go deleted file mode 100644 index 17a16c2..0000000 --- a/mcptools/UpdateProject.go +++ /dev/null @@ -1,214 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the UpdateProject tool -const updateProjectInputSchema = `{ - "properties": { - "body": { - "properties": { - "description": { - "example": "Updated description", - "maxLength": 2048, - "minLength": 4, - "type": [ - "string", - "null" - ] - }, - "displayName": { - "example": "My Updated Application", - "maxLength": 48, - "minLength": 4, - "pattern": "^[a-zA-Z0-9 _-]+$", - "type": "string" - }, - "enabledSecurityScan": { - "description": "Enable or disable security scanning for the project", - "example": false, - "type": [ - "boolean", - "null" - ] - } - }, - "required": [ - "displayName" - ], - "type": "object" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "body" - ], - "type": "object" -}` - -// Response Template for the UpdateProject tool (Status: 200, Content-Type: application/json) -const UpdateProjectResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Project updated successfully - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'true' - - **data** (Type: string): - - Example: 'project updated successfully' -` - -// Response Template for the UpdateProject tool (Status: 400, Content-Type: application/json) -const UpdateProjectResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProject tool (Status: 401, Content-Type: application/json) -const UpdateProjectResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProject tool (Status: 403, Content-Type: application/json) -const UpdateProjectResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the UpdateProject tool (Status: 404, Content-Type: application/json) -const UpdateProjectResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProject tool (Status: 500, Content-Type: application/json) -const UpdateProjectResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewUpdateProjectMCPTool creates the MCP Tool instance for UpdateProject -func NewUpdateProjectMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "UpdateProject", - "Update project - Updates project display name and description", - []byte(updateProjectInputSchema), - ) -} - -// UpdateProjectHandler is the handler function for the UpdateProject tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func UpdateProjectHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "UpdateProject") -} diff --git a/mcptools/UpdateProjectEnvironment.go b/mcptools/UpdateProjectEnvironment.go deleted file mode 100644 index 7a28ddb..0000000 --- a/mcptools/UpdateProjectEnvironment.go +++ /dev/null @@ -1,248 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the UpdateProjectEnvironment tool -const updateProjectEnvironmentInputSchema = `{ - "properties": { - "body": { - "properties": { - "branch": { - "description": "For VCS projects: The branch name to associate with the environment. Must exist in the repository. For image projects: This field should be omitted or null.", - "example": "main", - "maxLength": 255, - "minLength": 1, - "type": [ - "string", - "null" - ] - }, - "description": { - "example": "Updated production environment", - "maxLength": 2048, - "minLength": 4, - "pattern": "^[a-zA-Z0-9 _-]+$", - "type": "string" - }, - "displayName": { - "description": "Display name for the environment", - "example": "Production", - "maxLength": 48, - "minLength": 4, - "pattern": "^[a-zA-Z0-9 _-]+$", - "type": "string" - }, - "isAutoPromoteEnabled": { - "example": false, - "type": "boolean" - } - }, - "required": [ - "displayName", - "description" - ], - "type": "object" - }, - "environment_id": { - "description": "Environment unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "environment_id", - "body" - ], - "type": "object" -}` - -// Response Template for the UpdateProjectEnvironment tool (Status: 200, Content-Type: application/json) -const UpdateProjectEnvironmentResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Environment updated successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'project environment updated successfully' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the UpdateProjectEnvironment tool (Status: 400, Content-Type: application/json) -const UpdateProjectEnvironmentResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProjectEnvironment tool (Status: 401, Content-Type: application/json) -const UpdateProjectEnvironmentResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProjectEnvironment tool (Status: 403, Content-Type: application/json) -const UpdateProjectEnvironmentResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProjectEnvironment tool (Status: 404, Content-Type: application/json) -const UpdateProjectEnvironmentResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProjectEnvironment tool (Status: 422, Content-Type: application/json) -const UpdateProjectEnvironmentResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Unprocessable Entity - environment being deleted or project not active - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the UpdateProjectEnvironment tool (Status: 500, Content-Type: application/json) -const UpdateProjectEnvironmentResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// NewUpdateProjectEnvironmentMCPTool creates the MCP Tool instance for UpdateProjectEnvironment -func NewUpdateProjectEnvironmentMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "UpdateProjectEnvironment", - "Update project environment - Updates environment description, branch (for VCS projects), and auto-promote settings. For VCS projects: branch is required and must exist in the repository. For image projects: branch should be omitted or null.", - []byte(updateProjectEnvironmentInputSchema), - ) -} - -// UpdateProjectEnvironmentHandler is the handler function for the UpdateProjectEnvironment tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func UpdateProjectEnvironmentHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "UpdateProjectEnvironment") -} diff --git a/mcptools/UpdateProjectEnvironmentEnvironmentVariables.go b/mcptools/UpdateProjectEnvironmentEnvironmentVariables.go deleted file mode 100644 index c5f041e..0000000 --- a/mcptools/UpdateProjectEnvironmentEnvironmentVariables.go +++ /dev/null @@ -1,236 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the UpdateProjectEnvironmentEnvironmentVariables tool -const updateProjectEnvironmentEnvironmentVariablesInputSchema = `{ - "properties": { - "body": { - "properties": { - "port": { - "description": "Port number the application listens on (for image projects only)", - "example": 8080, - "maximum": 65535, - "minimum": 1, - "type": "integer" - }, - "runEnvs": { - "additionalProperties": { - "type": "string" - }, - "description": "Runtime environment variables", - "example": { - "API_KEY": "updated-prod-key", - "DATABASE_URL": "postgresql://prod-db:5432/mydb" - }, - "type": "object" - } - }, - "required": [ - "runEnvs" - ], - "type": "object" - }, - "environment_id": { - "description": "Environment unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "environment_id", - "body" - ], - "type": "object" -}` - -// Response Template for the UpdateProjectEnvironmentEnvironmentVariables tool (Status: 200, Content-Type: application/json) -const UpdateProjectEnvironmentEnvironmentVariablesResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Environment variables updated successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'project environment settings updated successfully' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the UpdateProjectEnvironmentEnvironmentVariables tool (Status: 400, Content-Type: application/json) -const UpdateProjectEnvironmentEnvironmentVariablesResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProjectEnvironmentEnvironmentVariables tool (Status: 401, Content-Type: application/json) -const UpdateProjectEnvironmentEnvironmentVariablesResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProjectEnvironmentEnvironmentVariables tool (Status: 403, Content-Type: application/json) -const UpdateProjectEnvironmentEnvironmentVariablesResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProjectEnvironmentEnvironmentVariables tool (Status: 404, Content-Type: application/json) -const UpdateProjectEnvironmentEnvironmentVariablesResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the UpdateProjectEnvironmentEnvironmentVariables tool (Status: 422, Content-Type: application/json) -const UpdateProjectEnvironmentEnvironmentVariablesResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Unprocessable Entity - environment being deleted or project not active - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProjectEnvironmentEnvironmentVariables tool (Status: 500, Content-Type: application/json) -const UpdateProjectEnvironmentEnvironmentVariablesResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewUpdateProjectEnvironmentEnvironmentVariablesMCPTool creates the MCP Tool instance for UpdateProjectEnvironmentEnvironmentVariables -func NewUpdateProjectEnvironmentEnvironmentVariablesMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "UpdateProjectEnvironmentEnvironmentVariables", - "Update environment variables - Updates runtime environment variables and settings for an environment. For image projects: can update both port and runEnvs. For VCS projects: can only update runEnvs.", - []byte(updateProjectEnvironmentEnvironmentVariablesInputSchema), - ) -} - -// UpdateProjectEnvironmentEnvironmentVariablesHandler is the handler function for the UpdateProjectEnvironmentEnvironmentVariables tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func UpdateProjectEnvironmentEnvironmentVariablesHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "UpdateProjectEnvironmentEnvironmentVariables") -} diff --git a/mcptools/UpdateProjectEnvironmentResources.go b/mcptools/UpdateProjectEnvironmentResources.go deleted file mode 100644 index 61a751c..0000000 --- a/mcptools/UpdateProjectEnvironmentResources.go +++ /dev/null @@ -1,238 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the UpdateProjectEnvironmentResources tool -const updateProjectEnvironmentResourcesInputSchema = `{ - "properties": { - "body": { - "properties": { - "cpu": { - "example": 500, - "maximum": 500, - "minimum": 200, - "type": "integer" - }, - "memory": { - "example": 1024, - "maximum": 1024, - "minimum": 500, - "type": "integer" - }, - "replicas": { - "example": 2, - "maximum": 3, - "minimum": 1, - "type": "integer" - } - }, - "required": [ - "cpu", - "memory", - "replicas" - ], - "type": "object" - }, - "environment_id": { - "description": "Environment unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "environment_id", - "body" - ], - "type": "object" -}` - -// Response Template for the UpdateProjectEnvironmentResources tool (Status: 200, Content-Type: application/json) -const UpdateProjectEnvironmentResourcesResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Environment resources updated successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'project environment resources updated successfully' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the UpdateProjectEnvironmentResources tool (Status: 400, Content-Type: application/json) -const UpdateProjectEnvironmentResourcesResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProjectEnvironmentResources tool (Status: 401, Content-Type: application/json) -const UpdateProjectEnvironmentResourcesResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProjectEnvironmentResources tool (Status: 403, Content-Type: application/json) -const UpdateProjectEnvironmentResourcesResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProjectEnvironmentResources tool (Status: 404, Content-Type: application/json) -const UpdateProjectEnvironmentResourcesResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProjectEnvironmentResources tool (Status: 422, Content-Type: application/json) -const UpdateProjectEnvironmentResourcesResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Unprocessable Entity - environment being deleted or project not active - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the UpdateProjectEnvironmentResources tool (Status: 500, Content-Type: application/json) -const UpdateProjectEnvironmentResourcesResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewUpdateProjectEnvironmentResourcesMCPTool creates the MCP Tool instance for UpdateProjectEnvironmentResources -func NewUpdateProjectEnvironmentResourcesMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "UpdateProjectEnvironmentResources", - "Update environment resources - Updates CPU, memory, and replica settings for an environment", - []byte(updateProjectEnvironmentResourcesInputSchema), - ) -} - -// UpdateProjectEnvironmentResourcesHandler is the handler function for the UpdateProjectEnvironmentResources tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func UpdateProjectEnvironmentResourcesHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "UpdateProjectEnvironmentResources") -} diff --git a/mcptools/UpdateProjectSettings.go b/mcptools/UpdateProjectSettings.go deleted file mode 100644 index d242cd1..0000000 --- a/mcptools/UpdateProjectSettings.go +++ /dev/null @@ -1,579 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the UpdateProjectSettings tool -const updateProjectSettingsInputSchema = `{ - "properties": { - "body": { - "oneOf": [ - { - "description": "Build and runtime settings for VCS projects", - "properties": { - "buildCommand": { - "description": "Command to build the project", - "example": "npm run build", - "maxLength": 255, - "type": [ - "string", - "null" - ] - }, - "buildDir": { - "description": "Directory where build output is located", - "example": "dist", - "maxLength": 255, - "type": [ - "string", - "null" - ] - }, - "buildFlag": { - "description": "Additional flags to pass to the build command", - "example": "-trimpath", - "maxLength": 255, - "type": [ - "string", - "null" - ] - }, - "buildFlags": { - "additionalProperties": { - "type": "string" - }, - "description": "Build-time environment variables (also accepts buildVars)", - "example": { - "NEXT_PUBLIC_API_URL": "https://api.example.com", - "NODE_ENV": "production" - }, - "type": "object" - }, - "buildVars": { - "additionalProperties": { - "type": "string" - }, - "description": "Build-time environment variables (alternative to buildFlags)", - "example": { - "NEXT_PUBLIC_API_URL": "https://api.example.com", - "NODE_ENV": "production" - }, - "type": "object" - }, - "directoryPath": { - "description": "Project directory path within the repository (defaults to root)", - "example": ".", - "maxLength": 255, - "type": [ - "string", - "null" - ] - }, - "framework": { - "description": "Framework name (e.g., nextjs, reactjs-spa, reactjs-ssr). If specified, runtime must be compatible.", - "example": "nextjs", - "maxLength": 255, - "type": [ - "string", - "null" - ] - }, - "hasDockerfile": { - "default": false, - "description": "Whether the project has a Dockerfile (if true, build settings may be ignored)", - "example": false, - "type": "boolean" - }, - "ignoreBranches": { - "description": "List of exact branch names to ignore for automatic deployments (not regex patterns)", - "example": [ - "develop", - "staging" - ], - "items": { - "maxLength": 255, - "type": "string" - }, - "type": "array" - }, - "installCommand": { - "description": "Command to install dependencies", - "example": "npm install", - "maxLength": 255, - "type": [ - "string", - "null" - ] - }, - "port": { - "description": "Port number the application listens on", - "example": 3000, - "maximum": 65535, - "minimum": 1, - "type": "integer" - }, - "runCommand": { - "description": "Command to run the application", - "example": "npm run start", - "maxLength": 255, - "type": [ - "string", - "null" - ] - }, - "runEnvs": { - "additionalProperties": { - "type": "string" - }, - "description": "Runtime environment variables", - "example": { - "API_KEY": "secret-key", - "DATABASE_URL": "postgresql://localhost:5432/mydb" - }, - "type": "object" - }, - "runFlag": { - "description": "Additional flags to pass to the run command", - "maxLength": 255, - "type": [ - "string", - "null" - ] - }, - "runtime": { - "description": "Runtime environment (e.g., node:20, golang:1.25, bun:1.3). Required if framework is not specified.", - "example": "node:20", - "maxLength": 255, - "type": [ - "string", - "null" - ] - }, - "useBuildAI": { - "default": false, - "description": "Whether to use Build AI for automated build configuration", - "example": false, - "type": "boolean" - } - }, - "type": "object" - }, - { - "additionalProperties": false, - "description": "Settings for image type projects", - "not": { - "properties": { - "buildCommand": { - "type": "string" - }, - "directoryPath": { - "type": "string" - }, - "framework": { - "type": "string" - }, - "hasDockerfile": { - "type": "boolean" - }, - "ignoreBranches": { - "items": { - "type": "string" - }, - "type": "array" - }, - "installCommand": { - "type": "string" - }, - "runtime": { - "type": "string" - }, - "useBuildAI": { - "type": "boolean" - } - }, - "type": "object" - }, - "properties": { - "port": { - "description": "Port number the application listens on", - "example": 8080, - "maximum": 65535, - "minimum": 1, - "type": "integer" - }, - "runEnvs": { - "additionalProperties": { - "type": "string" - }, - "description": "Runtime environment variables", - "example": { - "API_KEY": "secret-key", - "DATABASE_URL": "postgresql://localhost:5432/mydb" - }, - "type": "object" - } - }, - "required": [ - "port" - ], - "type": "object" - }, - { - "additionalProperties": false, - "allOf": [ - { - "not": { - "additionalProperties": false, - "properties": { - "port": { - "maximum": 65535, - "minimum": 1, - "type": "integer" - }, - "runEnvs": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - }, - "required": [ - "port" - ], - "type": "object" - } - }, - { - "not": { - "anyOf": [ - { - "properties": { - "ignoreBranches": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - }, - { - "properties": { - "buildFlags": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - }, - "type": "object" - } - ] - } - } - ], - "description": "Build and runtime settings for upload type projects", - "properties": { - "buildCommand": { - "description": "Command to build the project", - "example": "npm run build", - "maxLength": 255, - "type": [ - "string", - "null" - ] - }, - "buildDir": { - "description": "Directory where build output is located", - "example": "dist", - "maxLength": 255, - "type": [ - "string", - "null" - ] - }, - "buildFlag": { - "description": "Additional flags to pass to the build command", - "example": "-trimpath", - "maxLength": 255, - "type": [ - "string", - "null" - ] - }, - "buildVars": { - "additionalProperties": { - "type": "string" - }, - "description": "Build-time environment variables", - "example": { - "NEXT_PUBLIC_API_URL": "https://api.example.com", - "NODE_ENV": "production" - }, - "type": "object" - }, - "directoryPath": { - "description": "Project directory path within the uploaded files (defaults to root)", - "example": ".", - "maxLength": 255, - "type": [ - "string", - "null" - ] - }, - "framework": { - "description": "Framework name (e.g., nextjs, reactjs-spa, reactjs-ssr). Required if useBuildAI is false and hasDockerfile is false.", - "example": "nextjs", - "maxLength": 255, - "type": [ - "string", - "null" - ] - }, - "hasDockerfile": { - "default": false, - "description": "Whether the project has a Dockerfile (if true, build settings may be ignored)", - "example": false, - "type": "boolean" - }, - "installCommand": { - "description": "Command to install dependencies", - "example": "npm install", - "maxLength": 255, - "type": [ - "string", - "null" - ] - }, - "port": { - "description": "Port number the application listens on", - "example": 80, - "maximum": 65535, - "minimum": 1, - "type": [ - "integer", - "null" - ] - }, - "runCommand": { - "description": "Command to run the application", - "example": "npm run start", - "maxLength": 255, - "type": [ - "string", - "null" - ] - }, - "runEnvs": { - "additionalProperties": { - "type": "string" - }, - "description": "Runtime environment variables", - "example": { - "API_KEY": "secret-key", - "DATABASE_URL": "postgresql://localhost:5432/mydb" - }, - "type": "object" - }, - "runFlag": { - "description": "Additional flags to pass to the run command", - "maxLength": 255, - "type": [ - "string", - "null" - ] - }, - "runtime": { - "description": "Runtime environment (e.g., node:20, golang:1.25, bun:1.3, build-ai). Use \"build-ai\" to enable Build AI.", - "example": "build-ai", - "maxLength": 255, - "type": [ - "string", - "null" - ] - }, - "useBuildAI": { - "default": false, - "description": "Whether to use Build AI for automated build configuration (should be true when runtime is \"build-ai\")", - "example": true, - "type": "boolean" - } - }, - "type": "object" - } - ] - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "body" - ], - "type": "object" -}` - -// Response Template for the UpdateProjectSettings tool (Status: 200, Content-Type: application/json) -const UpdateProjectSettingsResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Project settings updated successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'project settings updated successfully' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the UpdateProjectSettings tool (Status: 400, Content-Type: application/json) -const UpdateProjectSettingsResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - invalid settings, validation error, or project not in active state - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProjectSettings tool (Status: 401, Content-Type: application/json) -const UpdateProjectSettingsResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProjectSettings tool (Status: 403, Content-Type: application/json) -const UpdateProjectSettingsResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProjectSettings tool (Status: 404, Content-Type: application/json) -const UpdateProjectSettingsResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProjectSettings tool (Status: 500, Content-Type: application/json) -const UpdateProjectSettingsResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewUpdateProjectSettingsMCPTool creates the MCP Tool instance for UpdateProjectSettings -func NewUpdateProjectSettingsMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "UpdateProjectSettings", - "Update project settings - Updates build and runtime settings for a project. For VCS projects: accepts VCSSettings schema with all build/runtime configuration options. For image projects: accepts ImageSettings schema with port and runtime environment variables. For upload projects: accepts UploadSettings schema with build and runtime configuration options.", - []byte(updateProjectSettingsInputSchema), - ) -} - -// UpdateProjectSettingsHandler is the handler function for the UpdateProjectSettings tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func UpdateProjectSettingsHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "UpdateProjectSettings") -} diff --git a/mcptools/UpdateProjectTemplate.go b/mcptools/UpdateProjectTemplate.go deleted file mode 100644 index 1bba234..0000000 --- a/mcptools/UpdateProjectTemplate.go +++ /dev/null @@ -1,236 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the UpdateProjectTemplate tool -const updateProjectTemplateInputSchema = `{ - "properties": { - "body": { - "properties": { - "amount": { - "maximum": 5000, - "minimum": 0, - "type": "number" - }, - "categories": { - "items": { - "maxLength": 128, - "type": "string" - }, - "maxItems": 5, - "type": "array" - }, - "description": { - "maxLength": 10000, - "minLength": 100, - "type": "string" - }, - "imageUri": { - "maxLength": 100, - "type": "string" - }, - "name": { - "maxLength": 100, - "minLength": 10, - "type": "string" - }, - "overview": { - "maxLength": 10000, - "minLength": 100, - "type": "string" - }, - "useCases": { - "maxLength": 10000, - "minLength": 100, - "type": "string" - }, - "videoUrl": { - "format": "uri", - "maxLength": 100, - "type": "string" - } - }, - "required": [ - "name", - "description", - "overview", - "useCases", - "videoUrl", - "imageUri" - ], - "type": "object" - }, - "template_id": { - "format": "uuid", - "type": "string" - } - }, - "required": [ - "template_id", - "body" - ], - "type": "object" -}` - -// Response Template for the UpdateProjectTemplate tool (Status: 200, Content-Type: application/json) -const UpdateProjectTemplateResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Template updated - -## Response Structure - -- Structure (Type: object): - - **status** (Type: string): - - Example: 'success' - - **data** (Type: object): - - **id**: Updated template ID (Type: string, uuid): -` - -// Response Template for the UpdateProjectTemplate tool (Status: 400, Content-Type: application/json) -const UpdateProjectTemplateResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProjectTemplate tool (Status: 401, Content-Type: application/json) -const UpdateProjectTemplateResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProjectTemplate tool (Status: 403, Content-Type: application/json) -const UpdateProjectTemplateResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProjectTemplate tool (Status: 404, Content-Type: application/json) -const UpdateProjectTemplateResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProjectTemplate tool (Status: 500, Content-Type: application/json) -const UpdateProjectTemplateResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewUpdateProjectTemplateMCPTool creates the MCP Tool instance for UpdateProjectTemplate -func NewUpdateProjectTemplateMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "UpdateProjectTemplate", - "Update project template - Updates the template metadata (name, description, overview, amount, use cases, video URL, image URI, categories). User must own the template.", - []byte(updateProjectTemplateInputSchema), - ) -} - -// UpdateProjectTemplateHandler is the handler function for the UpdateProjectTemplate tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func UpdateProjectTemplateHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "UpdateProjectTemplate") -} diff --git a/mcptools/UpdateProjectTemplateStatus.go b/mcptools/UpdateProjectTemplateStatus.go deleted file mode 100644 index 52d603d..0000000 --- a/mcptools/UpdateProjectTemplateStatus.go +++ /dev/null @@ -1,203 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the UpdateProjectTemplateStatus tool -const updateProjectTemplateStatusInputSchema = `{ - "properties": { - "template_id": { - "format": "uuid", - "type": "string" - } - }, - "required": [ - "template_id" - ], - "type": "object" -}` - -// Response Template for the UpdateProjectTemplateStatus tool (Status: 200, Content-Type: application/json) -const UpdateProjectTemplateStatusResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Status updated to underReview - -## Response Structure - -- Structure (Type: object): - - **status** (Type: string): - - Example: 'success' - - **data** (Type: object): - - **status** (Type: string): - - Example: 'underReview' -` - -// Response Template for the UpdateProjectTemplateStatus tool (Status: 400, Content-Type: application/json) -const UpdateProjectTemplateStatusResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProjectTemplateStatus tool (Status: 401, Content-Type: application/json) -const UpdateProjectTemplateStatusResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProjectTemplateStatus tool (Status: 403, Content-Type: application/json) -const UpdateProjectTemplateStatusResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProjectTemplateStatus tool (Status: 404, Content-Type: application/json) -const UpdateProjectTemplateStatusResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProjectTemplateStatus tool (Status: 422, Content-Type: application/json) -const UpdateProjectTemplateStatusResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Can only submit from draft or rejected - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UpdateProjectTemplateStatus tool (Status: 500, Content-Type: application/json) -const UpdateProjectTemplateStatusResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewUpdateProjectTemplateStatusMCPTool creates the MCP Tool instance for UpdateProjectTemplateStatus -func NewUpdateProjectTemplateStatusMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "UpdateProjectTemplateStatus", - "Send project template for review - Transitions template status from draft or rejected to underReview. No request body. User must own the template.", - []byte(updateProjectTemplateStatusInputSchema), - ) -} - -// UpdateProjectTemplateStatusHandler is the handler function for the UpdateProjectTemplateStatus tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func UpdateProjectTemplateStatusHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "UpdateProjectTemplateStatus") -} diff --git a/mcptools/UploadDeploymentFiles.go b/mcptools/UploadDeploymentFiles.go deleted file mode 100644 index b549eb0..0000000 --- a/mcptools/UploadDeploymentFiles.go +++ /dev/null @@ -1,259 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the UploadDeploymentFiles tool -const uploadDeploymentFilesInputSchema = `{ - "properties": { - "body": { - "properties": { - "files": { - "description": "Array of files to upload (maximum 100 files)", - "items": { - "properties": { - "content": { - "description": "File content (plain text for /files endpoint, base64-encoded for /files/base64 endpoint)", - "example": "\u003c!DOCTYPE html\u003e\u003chtml\u003e\u003cbody\u003eHello\u003c/body\u003e\u003c/html\u003e", - "type": "string" - }, - "path": { - "description": "File path relative to project root", - "example": "index.html", - "type": "string" - } - }, - "required": [ - "path", - "content" - ], - "type": "object" - }, - "maxItems": 100, - "type": "array" - } - }, - "required": [ - "files" - ], - "type": "object" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "body" - ], - "type": "object" -}` - -// Response Template for the UploadDeploymentFiles tool (Status: 200, Content-Type: application/json) -const UploadDeploymentFilesResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Deployment created successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **id** (Type: string, uuid): - - Example: '550e8400-e29b-41d4-a716-446655440000' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the UploadDeploymentFiles tool (Status: 400, Content-Type: application/json) -const UploadDeploymentFilesResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UploadDeploymentFiles tool (Status: 401, Content-Type: application/json) -const UploadDeploymentFilesResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UploadDeploymentFiles tool (Status: 403, Content-Type: application/json) -const UploadDeploymentFilesResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UploadDeploymentFiles tool (Status: 404, Content-Type: application/json) -const UploadDeploymentFilesResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UploadDeploymentFiles tool (Status: 422, Content-Type: application/json) -const UploadDeploymentFilesResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Unprocessable Entity - project is not an upload project or project not active - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the UploadDeploymentFiles tool (Status: 429, Content-Type: application/json) -const UploadDeploymentFilesResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 429 - -**Content-Type:** application/json - -> Too many requests - max manual deployments creation limit exceeded - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UploadDeploymentFiles tool (Status: 500, Content-Type: application/json) -const UploadDeploymentFilesResponseTemplate_H = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewUploadDeploymentFilesMCPTool creates the MCP Tool instance for UploadDeploymentFiles -func NewUploadDeploymentFilesMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "UploadDeploymentFiles", - "Upload deployment files - Creates a new deployment by uploading files directly. Only available for upload type projects. Files are provided as an array of path/content pairs.", - []byte(uploadDeploymentFilesInputSchema), - ) -} - -// UploadDeploymentFilesHandler is the handler function for the UploadDeploymentFiles tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func UploadDeploymentFilesHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "UploadDeploymentFiles") -} diff --git a/mcptools/UploadDeploymentZip.go b/mcptools/UploadDeploymentZip.go deleted file mode 100644 index bb57f4c..0000000 --- a/mcptools/UploadDeploymentZip.go +++ /dev/null @@ -1,237 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the UploadDeploymentZip tool -const uploadDeploymentZipInputSchema = `{ - "properties": { - "body": { - "properties": { - "file": { - "description": "ZIP file containing deployment files", - "format": "binary", - "type": "string" - } - }, - "type": "object" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "body" - ], - "type": "object" -}` - -// Response Template for the UploadDeploymentZip tool (Status: 200, Content-Type: application/json) -const UploadDeploymentZipResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Deployment created successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: object): - - **id** (Type: string, uuid): - - Example: '550e8400-e29b-41d4-a716-446655440000' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the UploadDeploymentZip tool (Status: 400, Content-Type: application/json) -const UploadDeploymentZipResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UploadDeploymentZip tool (Status: 401, Content-Type: application/json) -const UploadDeploymentZipResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UploadDeploymentZip tool (Status: 403, Content-Type: application/json) -const UploadDeploymentZipResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UploadDeploymentZip tool (Status: 404, Content-Type: application/json) -const UploadDeploymentZipResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the UploadDeploymentZip tool (Status: 422, Content-Type: application/json) -const UploadDeploymentZipResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Unprocessable Entity - project is not an upload project or project not active - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the UploadDeploymentZip tool (Status: 429, Content-Type: application/json) -const UploadDeploymentZipResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 429 - -**Content-Type:** application/json - -> Too many requests - max manual deployments creation limit exceeded - -## Response Structure - -- Structure (Type: object): - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' - - **success** (Type: boolean): - - Example: 'false' -` - -// Response Template for the UploadDeploymentZip tool (Status: 500, Content-Type: application/json) -const UploadDeploymentZipResponseTemplate_H = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewUploadDeploymentZipMCPTool creates the MCP Tool instance for UploadDeploymentZip -func NewUploadDeploymentZipMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "UploadDeploymentZip", - "Upload deployment as ZIP - Creates a new deployment by uploading a ZIP file. Only available for upload type projects.", - []byte(uploadDeploymentZipInputSchema), - ) -} - -// UploadDeploymentZipHandler is the handler function for the UploadDeploymentZip tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func UploadDeploymentZipHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "UploadDeploymentZip") -} diff --git a/mcptools/WakeupDeployment.go b/mcptools/WakeupDeployment.go deleted file mode 100644 index 7c7980e..0000000 --- a/mcptools/WakeupDeployment.go +++ /dev/null @@ -1,209 +0,0 @@ -package mcptools - -import ( - "context" - "fmt" - "github.com/mark3labs/mcp-go/mcp" -) - -// Input Schema for the WakeupDeployment tool -const wakeupDeploymentInputSchema = `{ - "properties": { - "deployment_id": { - "description": "Deployment unique identifier", - "format": "uuid", - "type": "string" - }, - "project_id": { - "description": "Project unique identifier", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "project_id", - "deployment_id" - ], - "type": "object" -}` - -// Response Template for the WakeupDeployment tool (Status: 200, Content-Type: application/json) -const WakeupDeploymentResponseTemplate_A = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 200 - -**Content-Type:** application/json - -> Deployment wake up initiated successfully - -## Response Structure - -- Structure (Type: object): - - **data** (Type: string): - - Example: 'deployment is being woken up' - - **success** (Type: boolean): - - Example: 'true' -` - -// Response Template for the WakeupDeployment tool (Status: 400, Content-Type: application/json) -const WakeupDeploymentResponseTemplate_B = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 400 - -**Content-Type:** application/json - -> Bad request - validation error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the WakeupDeployment tool (Status: 401, Content-Type: application/json) -const WakeupDeploymentResponseTemplate_C = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 401 - -**Content-Type:** application/json - -> Unauthorized - authentication required - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the WakeupDeployment tool (Status: 403, Content-Type: application/json) -const WakeupDeploymentResponseTemplate_D = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 403 - -**Content-Type:** application/json - -> Forbidden - user does not have permission - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the WakeupDeployment tool (Status: 404, Content-Type: application/json) -const WakeupDeploymentResponseTemplate_E = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 404 - -**Content-Type:** application/json - -> Not found - resource does not exist - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the WakeupDeployment tool (Status: 422, Content-Type: application/json) -const WakeupDeploymentResponseTemplate_F = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 422 - -**Content-Type:** application/json - -> Unprocessable Entity - deployment is not sleeping, cancelled deployment cannot be woken up, or project not active - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// Response Template for the WakeupDeployment tool (Status: 500, Content-Type: application/json) -const WakeupDeploymentResponseTemplate_G = `# API Response Information - -Below is the response template for this API endpoint. - -The template shows a possible response, including its status code and content type, to help you understand and generate correct outputs. - -**Status Code:** 500 - -**Content-Type:** application/json - -> Internal server error - -## Response Structure - -- Structure (Type: object): - - **success** (Type: boolean): - - Example: 'false' - - **message**: Error message describing what went wrong (Type: string): - - Example: 'invalid uniqueName' -` - -// NewWakeupDeploymentMCPTool creates the MCP Tool instance for WakeupDeployment -func NewWakeupDeploymentMCPTool() mcp.Tool { - return mcp.NewToolWithRawSchema( - "WakeupDeployment", - "Wake up deployment - Wakes up a sleeping deployment by transitioning it to deploying state. If the project has reached the maximum number of deployed deployments, the oldest deployed deployment will be terminated to make room.", - []byte(wakeupDeploymentInputSchema), - ) -} - -// WakeupDeploymentHandler is the handler function for the WakeupDeployment tool. -// This function is automatically generated. Users should implement the actual -// logic within this function body to integrate with backend APIs. -// You can generate types, http client and helpers for parsing request params to facilitate the implementation. -func WakeupDeploymentHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - - // IMPORTANT: Replace the following placeholder implementation with your actual logic. - // Use the 'request' parameter to access tool call arguments. - // Make HTTP calls or interact with services as needed. - // Return an *mcp.CallToolResult with the response payload, or an error. - - // Example placeholder implementation: - // Extract the parameters from the request and parse them. - // Call your backend API or perform the necessary operations using 'params'. - // Handle the response and errors accordingly. - return nil, fmt.Errorf("%s not implemented", "WakeupDeployment") -} diff --git a/package.json b/package.json new file mode 100644 index 0000000..976e194 --- /dev/null +++ b/package.json @@ -0,0 +1,14 @@ +{ + "name": "createos-mcp-tooling", + "private": true, + "type": "module", + "scripts": { + "count-tokens": "bun scripts/count-tokens.ts", + "smoke": "bun scripts/smoke.ts", + "soak": "bun scripts/soak.ts" + }, + "devDependencies": { + "tiktoken": "^1.0.17", + "@types/bun": "latest" + } +} diff --git a/scripts/count-tokens.ts b/scripts/count-tokens.ts new file mode 100644 index 0000000..e55d4db --- /dev/null +++ b/scripts/count-tokens.ts @@ -0,0 +1,74 @@ +#!/usr/bin/env bun +import { encoding_for_model } from "tiktoken"; + +const SEARCH_DESC = `Code Mode: introspect the CreateOS OpenAPI spec from a sandboxed JS arrow fn. + +When: discover endpoints/params/schemas BEFORE calling execute. No network in this mode. + +Globals: spec ($refs resolved, descriptions stripped), console, sleep(ms). +Result envelope: {status:"done"|"error", result, logs} | {status:"error", errorKind:"userCode"|"timeout"|"infra", error, stack}. +Limits: 5s timeout, 1MB code, 64KB result. + +See resource code-mode://intro and prompt code-mode/api-discovery.`; + +const EXECUTE_DESC = `Code Mode: run JS against the CreateOS API in a fresh V8 isolate. Auth forwarded from caller. + +API shape: + api..(args) typed call; group = first OpenAPI tag, operationId from spec. + api.raw(method, path, {query, headers, body}) escape hatch for unmapped routes. + Path params come from args by name: api.projects.getProject({id:"..."}). + Query/body inferred from operation; pass {body:{...}} explicitly to override. + +Errors: non-2xx throws ApiError {name, status, body, path}. Catch in user code if you want to handle them. + +Result envelope: + sync -> {status:"done", result, logs} + >90s -> {status:"running", jobId} -> loop pollJob(jobId) + failure -> {status:"error", errorKind:"userCode"|"timeout"|"infra"|"capacity", error, stack, logs} + +Limits: 90s sync window, 600s wall cap, 1MB code, 64KB result, 50 concurrent jobs. +Sandbox: no fs, no env, no ambient fetch. Only api/console/sleep/spec. + +See resource code-mode://api-shape and prompt code-mode/deploy-example.`; + +const POLLJOB_DESC = `Code Mode: drain a long-running execute() job. + +When: a prior execute() returned {status:"running", jobId}. Loop until status != "running". +Blocks up to ~90s per call (long-poll). + +Result envelope: {status:"running", jobId, logsSoFar} | {status:"done", result, logs} | {status:"error", errorKind:"userCode"|"timeout"|"infra"|"jobMissing", error, stack}. +Wall cap on the underlying job: 600s. Jobs evicted 30 min after terminal.`; + +const TOOLS: { name: string; description: string; inputSchema: object }[] = [ + { name: "GetQuotas", description: "Get the user's quota limits.", inputSchema: { type: "object", properties: {} } }, + { name: "GetSupportedProjectTypes", description: "List project types the platform supports.", inputSchema: { type: "object", properties: {} } }, + { name: "CheckProjectUniqueName", description: "Check whether a project unique name is available.", inputSchema: { type: "object", properties: { uniqueName: { type: "string" } }, required: ["uniqueName"] } }, + { name: "CreateProject", description: "Create a new project.", inputSchema: { type: "object", properties: { name: { type: "string" }, projectType: { type: "string" } }, required: ["name", "projectType"] } }, + { name: "UploadDeploymentBase64Files", description: "Upload base64-encoded files for a deployment.", inputSchema: { type: "object", properties: { projectId: { type: "string" }, files: { type: "array" } }, required: ["projectId", "files"] } }, + { name: "GetDeployment", description: "Get a deployment by id.", inputSchema: { type: "object", properties: { id: { type: "string" } }, required: ["id"] } }, + { name: "CancelDeployment", description: "Cancel an in-progress deployment.", inputSchema: { type: "object", properties: { id: { type: "string" } }, required: ["id"] } }, + + { name: "search", description: SEARCH_DESC, inputSchema: { type: "object", properties: { code: { type: "string" } }, required: ["code"] } }, + { name: "execute", description: EXECUTE_DESC, inputSchema: { type: "object", properties: { code: { type: "string" } }, required: ["code"] } }, + { name: "pollJob", description: POLLJOB_DESC, inputSchema: { type: "object", properties: { jobId: { type: "string" } }, required: ["jobId"] } }, +]; + +const enc = encoding_for_model("gpt-4"); +let total = 0; +for (const tool of TOOLS) { + const blob = JSON.stringify(tool); + const tokens = enc.encode(blob).length; + total += tokens; + console.log(`${tool.name}: ${tokens}`); +} +enc.free(); + +console.log(`---`); +console.log(`total: ${total}`); + +const BUDGET = 1500; +if (total > BUDGET) { + console.error(`token budget exceeded: ${total} > ${BUDGET}`); + process.exit(1); +} +console.log(`within budget (${BUDGET})`); diff --git a/scripts/smoke.ts b/scripts/smoke.ts new file mode 100644 index 0000000..207ce98 --- /dev/null +++ b/scripts/smoke.ts @@ -0,0 +1,25 @@ +#!/usr/bin/env bun +const URL = process.env.WORKERD_URL ?? "http://127.0.0.1:8787"; +const N = Number(process.env.SMOKE_N ?? 50); + +const start = Date.now(); +const results = await Promise.all( + Array.from({ length: N }, async (_, i) => { + const t = performance.now(); + const r = await fetch(URL + "/run", { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ + mode: "search", + code: "async () => Object.keys(spec.paths).length", + }), + }); + const body = await r.json(); + return { i, dur: performance.now() - t, ok: body.status === "done" }; + }), +); +const ok = results.filter((r) => r.ok).length; +const durs = results.map((r) => r.dur).sort((a, b) => a - b); +const p = (q: number) => durs[Math.floor(q * durs.length)]; +console.log(`ok=${ok}/${N} elapsed=${Date.now() - start}ms p50=${p(0.5).toFixed(0)}ms p95=${p(0.95).toFixed(0)}ms`); +if (ok < N) process.exit(1); diff --git a/scripts/soak.ts b/scripts/soak.ts new file mode 100644 index 0000000..96b6a56 --- /dev/null +++ b/scripts/soak.ts @@ -0,0 +1,43 @@ +#!/usr/bin/env bun +const URL = process.env.WORKERD_URL ?? "http://127.0.0.1:8787"; +const TOTAL = Number(process.env.SOAK_TOTAL ?? 1000); +const PARALLEL = Number(process.env.SOAK_PAR ?? 10); +const DURATION_MS = Number(process.env.SOAK_DURATION_MS ?? 600_000); + +const start = Date.now(); +let claimed = 0; // requests handed out (no overshoot) +let succeeded = 0; +let failed = 0; +let errored = 0; + +async function worker() { + while (true) { + if (Date.now() - start >= DURATION_MS) return; + const myIdx = claimed; + if (myIdx >= TOTAL) return; + claimed++; + try { + const r = await fetch(URL + "/run", { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ + mode: "search", + code: "async () => Object.keys(spec.paths).length", + }), + }); + const body = await r.json(); + if (body.status === "done") succeeded++; + else failed++; + } catch { + errored++; + } + } +} + +await Promise.all(Array.from({ length: PARALLEL }, worker)); + +const total = succeeded + failed + errored; +console.log( + `claimed=${claimed} total=${total} succeeded=${succeeded} failed=${failed} errored=${errored} elapsed=${Date.now() - start}ms`, +); +if (failed > 0 || errored > 0) process.exit(1); diff --git a/server.go b/server.go index 3cf5706..a728c5d 100644 --- a/server.go +++ b/server.go @@ -1,108 +1,58 @@ package main import ( + "os" + + "github.com/NodeOps-app/createos-mcp/codemode" handler "github.com/NodeOps-app/createos-mcp/handlers" "github.com/NodeOps-app/createos-mcp/mcptools" "github.com/mark3labs/mcp-go/server" ) -// NewMCPServer creates and returns an MCP server with all tools registered +// NewMCPServer creates and returns an MCP server with all tools registered. +// +// v2: 7 native fast-path tools + 3 code-mode tools (search, execute, pollJob). +// The previous 87 long-tail tools are reachable via search/execute against the +// CreateOS OpenAPI spec, served by the workerd sidecar. func NewMCPServer() *server.MCPServer { - // Create a new MCP server s := server.NewMCPServer( - "MCP Server", - "1.0.0", + "CreateOS MCP (Code Mode v2)", + "2.0.0", server.WithToolCapabilities(true), + server.WithResourceCapabilities(false, false), + server.WithPromptCapabilities(false), server.WithLogging(), ) - // Register all tools - s.AddTool(mcptools.NewAddProjectsToAppMCPTool(), handler.AddProjectsToAppHandler) - s.AddTool(mcptools.NewAddServicesToAppMCPTool(), handler.AddServicesToAppHandler) - s.AddTool(mcptools.NewAssignDeploymentToProjectEnvironmentMCPTool(), handler.AssignDeploymentToProjectEnvironmentHandler) - s.AddTool(mcptools.NewBuyProjectTemplateMCPTool(), handler.BuyProjectTemplateHandler) - s.AddTool(mcptools.NewCancelDeploymentMCPTool(), handler.CancelDeploymentHandler) - s.AddTool(mcptools.NewCheckAPIKeyUniqueNameMCPTool(), handler.CheckAPIKeyUniqueNameHandler) - s.AddTool(mcptools.NewCheckProjectEnvironmentUniqueNameMCPTool(), handler.CheckProjectEnvironmentUniqueNameHandler) - s.AddTool(mcptools.NewCheckProjectUniqueNameMCPTool(), handler.CheckProjectUniqueNameHandler) - s.AddTool(mcptools.NewCreateAPIKeyMCPTool(), handler.CreateAPIKeyHandler) - s.AddTool(mcptools.NewCreateAppMCPTool(), handler.CreateAppHandler) - s.AddTool(mcptools.NewCreateCronjobMCPTool(), handler.CreateCronjobHandler) - s.AddTool(mcptools.NewCreateDeploymentMCPTool(), handler.CreateDeploymentHandler) - s.AddTool(mcptools.NewCreateDomainMCPTool(), handler.CreateDomainHandler) - s.AddTool(mcptools.NewCreateProjectMCPTool(), handler.CreateProjectHandler) - s.AddTool(mcptools.NewCreateProjectEnvironmentMCPTool(), handler.CreateProjectEnvironmentHandler) - s.AddTool(mcptools.NewCreateProjectTemplateMCPTool(), handler.CreateProjectTemplateHandler) - s.AddTool(mcptools.NewDeleteAppMCPTool(), handler.DeleteAppHandler) - s.AddTool(mcptools.NewDeleteCronjobMCPTool(), handler.DeleteCronjobHandler) - s.AddTool(mcptools.NewDeleteDeploymentMCPTool(), handler.DeleteDeploymentHandler) - s.AddTool(mcptools.NewDeleteDomainMCPTool(), handler.DeleteDomainHandler) - s.AddTool(mcptools.NewDeleteProjectMCPTool(), handler.DeleteProjectHandler) - s.AddTool(mcptools.NewDeleteProjectEnvironmentMCPTool(), handler.DeleteProjectEnvironmentHandler) - s.AddTool(mcptools.NewDeleteProjectTemplateMCPTool(), handler.DeleteProjectTemplateHandler) - s.AddTool(mcptools.NewDeployProjectTemplateViaGithubMCPTool(), handler.DeployProjectTemplateViaGithubHandler) - s.AddTool(mcptools.NewDownloadDeploymentMCPTool(), handler.DownloadDeploymentHandler) - s.AddTool(mcptools.NewDownloadProjectTemplateMCPTool(), handler.DownloadProjectTemplateHandler) - s.AddTool(mcptools.NewGetBuildLogsMCPTool(), handler.GetBuildLogsHandler) - s.AddTool(mcptools.NewGetCronjobMCPTool(), handler.GetCronjobHandler) - s.AddTool(mcptools.NewGetCurrentUserMCPTool(), handler.GetCurrentUserHandler) - s.AddTool(mcptools.NewGetDeploymentMCPTool(), handler.GetDeploymentHandler) - s.AddTool(mcptools.NewGetDeploymentLogsMCPTool(), handler.GetDeploymentLogsHandler) - s.AddTool(mcptools.NewGetGithubRepositoryContentMCPTool(), handler.GetGithubRepositoryContentHandler) - s.AddTool(mcptools.NewGetProjectMCPTool(), handler.GetProjectHandler) - s.AddTool(mcptools.NewGetProjectEnvironmentLogsMCPTool(), handler.GetProjectEnvironmentLogsHandler) - s.AddTool(mcptools.NewGetProjectTemplateMCPTool(), handler.GetProjectTemplateHandler) - s.AddTool(mcptools.NewGetProjectTransferUriMCPTool(), handler.GetProjectTransferUriHandler) + // Native fast-path tools (v2: 7 retained). s.AddTool(mcptools.NewGetQuotasMCPTool(), handler.GetQuotasHandler) - s.AddTool(mcptools.NewGetSecurityScanMCPTool(), handler.GetSecurityScanHandler) - s.AddTool(mcptools.NewGetSecurityScanDownloadUriMCPTool(), handler.GetSecurityScanDownloadUriHandler) s.AddTool(mcptools.NewGetSupportedProjectTypesMCPTool(), handler.GetSupportedProjectTypesHandler) - s.AddTool(mcptools.NewInstallGithubAppMCPTool(), handler.InstallGithubAppHandler) - s.AddTool(mcptools.NewListAPIKeysMCPTool(), handler.ListAPIKeysHandler) - s.AddTool(mcptools.NewListAppsMCPTool(), handler.ListAppsHandler) - s.AddTool(mcptools.NewListConnectedGithubAccountsMCPTool(), handler.ListConnectedGithubAccountsHandler) - s.AddTool(mcptools.NewListCronjobActivitiesMCPTool(), handler.ListCronjobActivitiesHandler) - s.AddTool(mcptools.NewListCronjobsMCPTool(), handler.ListCronjobsHandler) - s.AddTool(mcptools.NewListDeploymentsMCPTool(), handler.ListDeploymentsHandler) - s.AddTool(mcptools.NewListDomainsMCPTool(), handler.ListDomainsHandler) - s.AddTool(mcptools.NewListGithubRepositoriesMCPTool(), handler.ListGithubRepositoriesHandler) - s.AddTool(mcptools.NewListGithubRepositoryBranchesMCPTool(), handler.ListGithubRepositoryBranchesHandler) - s.AddTool(mcptools.NewListMyProjectTemplatesMCPTool(), handler.ListMyProjectTemplatesHandler) - s.AddTool(mcptools.NewListProjectEnvironmentsMCPTool(), handler.ListProjectEnvironmentsHandler) - s.AddTool(mcptools.NewListProjectTemplateCountsMCPTool(), handler.ListProjectTemplateCountsHandler) - s.AddTool(mcptools.NewListProjectTemplatePurchasesMCPTool(), handler.ListProjectTemplatePurchasesHandler) - s.AddTool(mcptools.NewListProjectTemplateRejectionsMCPTool(), handler.ListProjectTemplateRejectionsHandler) - s.AddTool(mcptools.NewListProjectTransferHistoryMCPTool(), handler.ListProjectTransferHistoryHandler) - s.AddTool(mcptools.NewListProjectsMCPTool(), handler.ListProjectsHandler) - s.AddTool(mcptools.NewListProjectsByAppMCPTool(), handler.ListProjectsByAppHandler) - s.AddTool(mcptools.NewListPublishedProjectTemplatesMCPTool(), handler.ListPublishedProjectTemplatesHandler) - s.AddTool(mcptools.NewListServicesByAppMCPTool(), handler.ListServicesByAppHandler) - s.AddTool(mcptools.NewRefreshDomainMCPTool(), handler.RefreshDomainHandler) - s.AddTool(mcptools.NewRemoveProjectsFromAppMCPTool(), handler.RemoveProjectsFromAppHandler) - s.AddTool(mcptools.NewRemoveServicesFromAppMCPTool(), handler.RemoveServicesFromAppHandler) - s.AddTool(mcptools.NewRetriggerDeploymentMCPTool(), handler.RetriggerDeploymentHandler) - s.AddTool(mcptools.NewRetriggerSecurityScanMCPTool(), handler.RetriggerSecurityScanHandler) - s.AddTool(mcptools.NewRevokeAPIKeyMCPTool(), handler.RevokeAPIKeyHandler) - s.AddTool(mcptools.NewSuspendCronjobMCPTool(), handler.SuspendCronjobHandler) - s.AddTool(mcptools.NewTransferProjectMCPTool(), handler.TransferProjectHandler) - s.AddTool(mcptools.NewTriggerLatestDeploymentMCPTool(), handler.TriggerLatestDeploymentHandler) - s.AddTool(mcptools.NewTriggerSecurityScanMCPTool(), handler.TriggerSecurityScanHandler) - s.AddTool(mcptools.NewUnsuspendCronjobMCPTool(), handler.UnsuspendCronjobHandler) - s.AddTool(mcptools.NewUpdateAPIKeyMCPTool(), handler.UpdateAPIKeyHandler) - s.AddTool(mcptools.NewUpdateAppMCPTool(), handler.UpdateAppHandler) - s.AddTool(mcptools.NewUpdateCronjobMCPTool(), handler.UpdateCronjobHandler) - s.AddTool(mcptools.NewUpdateDomainEnvironmentMCPTool(), handler.UpdateDomainEnvironmentHandler) - s.AddTool(mcptools.NewUpdateProjectMCPTool(), handler.UpdateProjectHandler) - s.AddTool(mcptools.NewUpdateProjectEnvironmentMCPTool(), handler.UpdateProjectEnvironmentHandler) - s.AddTool(mcptools.NewUpdateProjectEnvironmentEnvironmentVariablesMCPTool(), handler.UpdateProjectEnvironmentEnvironmentVariablesHandler) - s.AddTool(mcptools.NewUpdateProjectEnvironmentResourcesMCPTool(), handler.UpdateProjectEnvironmentResourcesHandler) - s.AddTool(mcptools.NewUpdateProjectSettingsMCPTool(), handler.UpdateProjectSettingsHandler) - s.AddTool(mcptools.NewUpdateProjectTemplateMCPTool(), handler.UpdateProjectTemplateHandler) - s.AddTool(mcptools.NewUpdateProjectTemplateStatusMCPTool(), handler.UpdateProjectTemplateStatusHandler) + s.AddTool(mcptools.NewCheckProjectUniqueNameMCPTool(), handler.CheckProjectUniqueNameHandler) + s.AddTool(mcptools.NewCreateProjectMCPTool(), handler.CreateProjectHandler) s.AddTool(mcptools.NewUploadDeploymentBase64FilesMCPTool(), handler.UploadDeploymentBase64FilesHandler) - s.AddTool(mcptools.NewUploadDeploymentFilesMCPTool(), handler.UploadDeploymentFilesHandler) - s.AddTool(mcptools.NewUploadDeploymentZipMCPTool(), handler.UploadDeploymentZipHandler) - s.AddTool(mcptools.NewWakeupDeploymentMCPTool(), handler.WakeupDeploymentHandler) + s.AddTool(mcptools.NewGetDeploymentMCPTool(), handler.GetDeploymentHandler) + s.AddTool(mcptools.NewCancelDeploymentMCPTool(), handler.CancelDeploymentHandler) + + // Code Mode tools. + workerdURL := os.Getenv("WORKERD_URL") + if workerdURL == "" { + workerdURL = "http://127.0.0.1:8787" + } + cmHandler := &codemode.Handler{Client: codemode.NewClient(workerdURL)} + s.AddTool(codemode.NewSearchTool(), cmHandler.Search) + s.AddTool(codemode.NewExecuteTool(), cmHandler.Execute) + s.AddTool(codemode.NewPollJobTool(), cmHandler.PollJob) + + // Discovery surface so clients/agents can pull deeper docs on demand. + introRes, introHandler := codemode.NewIntroResource() + s.AddResource(introRes, server.ResourceHandlerFunc(introHandler)) + apiRes, apiHandler := codemode.NewAPIShapeResource() + s.AddResource(apiRes, server.ResourceHandlerFunc(apiHandler)) + + deployPrompt, deployHandler := codemode.NewDeployExamplePrompt() + s.AddPrompt(deployPrompt, server.PromptHandlerFunc(deployHandler)) + discoveryPrompt, discoveryHandler := codemode.NewAPIDiscoveryPrompt() + s.AddPrompt(discoveryPrompt, server.PromptHandlerFunc(discoveryHandler)) return s }