### Navigate to Tower Examples Directory Source: https://docs.tower.dev/docs/getting-started/quickstart-with-mcp Change your current directory to the cloned Tower examples repository to start a Claude session. ```bash cd tower-examples ``` -------------------------------- ### HTTP GET Request Example Source: https://docs.tower.dev/docs/reference/api/describe-account Example of how to make an HTTP GET request to the accounts endpoint. ```http GET ## https://api.tower.dev/v1/accounts/:name ``` -------------------------------- ### C# HttpClient Example for Listing Guests Source: https://docs.tower.dev/docs/reference/api/list-guests Example of how to use HttpClient in C# to make a GET request to the /v1/guests endpoint. Ensure you replace `` with your actual access token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.tower.dev/v1/guests"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Start Claude Session Source: https://docs.tower.dev/docs/getting-started/quickstart-with-mcp Initiate a Claude session in the Tower examples directory. ```bash claude ``` -------------------------------- ### C# HttpClient Example Source: https://docs.tower.dev/docs/reference/api/describe-account Example of making a GET request to the accounts endpoint using C# HttpClient. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.tower.dev/v1/accounts/:name"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Start Tower Runner on macOS Source: https://docs.tower.dev/docs/using-tower/self-hosted-runner-installation Command to start the Tower Runner service after installation and configuration. ```bash tower-runner start ``` -------------------------------- ### C# Example for Deploy Application Source: https://docs.tower.dev/docs/reference/api/deploy-app Example code in C# demonstrating how to call the Deploy Application endpoint using HttpClient. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://api.tower.dev/v1/apps/:name/deploy"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var content = new StringContent("{\n \"source_uri\": \"string\"\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Install Tower SDK Source: https://docs.tower.dev/docs/reference/tower-sdk Install the Tower SDK using pip. This command installs the SDK along with the Tower CLI. ```bash pip install tower ``` -------------------------------- ### Local Run Output Example Source: https://docs.tower.dev/docs/concepts/runs Example output from a successful local run of an app, showing dependency fetching, package building, and application execution logs. ```text ✔ Getting secrets... Done! ✔ Building package... Done! Success! App `hello-world` has been launched 2024-11-20 08:44:45 | Hello, world! 2024-11-20 08:44:46 | Hello, world! 2024-11-20 08:44:47 | Hello, world! 2024-11-20 08:44:48 | Hello, world! 2024-11-20 08:44:49 | Hello, world! Success! Your app exited cleanly. ``` -------------------------------- ### Clone Tower Examples Repository Source: https://docs.tower.dev/docs/getting-started/quickstart-with-mcp Clone this repository to access pre-built examples for learning and development with Tower. ```bash git clone https://github.com/tower/tower-examples ``` -------------------------------- ### C# HttpClient Example for Device Login Ticket Source: https://docs.tower.dev/docs/reference/api/create-device-login-ticket Example using C# HttpClient to send a GET request to the device login endpoint. Ensure the HttpClient is properly configured and handles the response asynchronously. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.tower.dev/v1/login/device"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example Source: https://docs.tower.dev/docs/reference/api/describe-app-version Example of how to make a GET request to the Tower API using HttpClient in C# to describe an app version. Includes setting headers for Accept and Authorization. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.tower.dev/v1/apps/:name/versions/:num"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example Source: https://docs.tower.dev/docs/reference/api/describe-app Demonstrates how to make a GET request to the Tower API using HttpClient in C#. Ensure you replace '' with your actual access token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.tower.dev/v1/apps/:name"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### List Apps GET Request Source: https://docs.tower.dev/docs/reference/api/list-apps Use this endpoint to retrieve all applications for the current account. No specific setup or imports are required beyond making the HTTP GET request. ```http GET /apps ``` -------------------------------- ### Example: Running Locally Source: https://docs.tower.dev/docs/using-tower/advanced When running a Tower app with the `--local` parameter, the environment is typically set to 'local'. This example shows the expected output from the SDK method. ```bash tower run --local ``` ```text ... You are in local! ``` -------------------------------- ### Fetch Runs using HttpClient in C# Source: https://docs.tower.dev/docs/reference/api/search-runs Example of how to make a GET request to the /v1/runs endpoint using HttpClient in C#. Ensure you replace `` with your actual access token. The response is read as a string. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.tower.dev/v1/runs"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Clone Tower Example Repository Source: https://docs.tower.dev/docs/using-tower/develop Clone the official Tower examples repository to your local machine to explore sample applications and structures. ```bash git clone https://github.com/tower/tower-examples ``` -------------------------------- ### C# Example: List Team Invitations Source: https://docs.tower.dev/docs/reference/api/list-my-team-invitations This C# code snippet demonstrates how to make a GET request to the team invitations endpoint using HttpClient. Remember to replace `` with your actual access token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.tower.dev/v1/team-invites"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example Source: https://docs.tower.dev/docs/reference/api/deploy-app Example of deploying an app using HttpClient in C#. Ensure the Authorization header is correctly set with a valid bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://api.tower.dev/v1/apps/:name/deploy"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var content = new StringContent("{\n \"source_uri\": \"string\"\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Example: Running in Default Environment Source: https://docs.tower.dev/docs/using-tower/advanced When running a Tower app without the `--local` parameter, the environment defaults to 'default'. This example shows the command to schedule a run and the subsequent log output indicating the environment. ```bash tower run ``` ```text ✔ Scheduling run... Done! Success! Run #2 for app `datafusion-transform` has been scheduled ``` ```bash tower apps logs datafusion-transform#2 ``` ```text ✔ Fetching logs... Done! You are in default! ``` -------------------------------- ### C# HttpClient Example for Access Token Authentication Source: https://docs.tower.dev/docs/reference/api/describe-session Demonstrates how to make a GET request to the Tower API using HttpClient in C# with a bearer token for authorization. Ensure the token is correctly formatted. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.tower.dev/v1/session"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example Source: https://docs.tower.dev/docs/reference/api/list-webhooks Example of how to list webhooks using C# HttpClient. It demonstrates setting the request method, URL, headers, and handling the response. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.tower.dev/v1/webhooks"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Start and Check Tower Runner Service on Windows (MSI) Source: https://docs.tower.dev/docs/using-tower/self-hosted-runner-installation Start the Tower Runner service and verify its status. ```powershell Start-Service -Name TowerRunner Get-Service -Name TowerRunner ``` -------------------------------- ### C# Example: Update App Environment Source: https://docs.tower.dev/docs/reference/api/update-app-environment Example using HttpClient in C# to send a PUT request to update an app's environment version. Ensure you replace placeholders like '' and provide valid app/environment names. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Put, "https://api.tower.dev/v1/apps/:name/environments/:environment"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var content = new StringContent("{\n \"version\": \"string\"\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Start and Verify Tower Runner Service Source: https://docs.tower.dev/docs/using-tower/self-hosted-runner-installation Enables and starts the Tower Runner service using systemd, checks its status, and follows its logs. Requires root/sudo privileges. ```bash sudo systemctl enable --now tower-runner sudo systemctl status tower-runner journalctl -u tower-runner -f ``` -------------------------------- ### Install Tower Runner MSI on Windows (Versioned x64) Source: https://docs.tower.dev/docs/using-tower/self-hosted-runner-installation Download a specific version of the Tower Runner MSI installer for Windows (x64). ```powershell Invoke-WebRequest -Uri "https://tower-packages.s3.us-east-1.amazonaws.com/releases/tower-runner/0.8.17/tower-runner-x64-0.8.17.msi" -OutFile "tower-runner.msi" ``` -------------------------------- ### Download and Install Tower Runner (.deb) Source: https://docs.tower.dev/docs/using-tower/self-hosted-runner-installation Installs the Tower Runner using the .deb package on Debian/Ubuntu systems. Use the latest URL for the most recent version or a versioned URL for a specific release. Requires root/sudo privileges. ```bash curl -L -O https://tower-packages.s3.us-east-1.amazonaws.com/releases/tower-runner/latest/tower-runner_amd64.deb sudo dpkg -i tower-runner_amd64.deb ``` ```bash curl -L -O https://tower-packages.s3.us-east-1.amazonaws.com/releases/tower-runner/latest/tower-runner_arm64.deb sudo dpkg -i tower-runner_arm64.deb ``` ```bash curl -L -O https://tower-packages.s3.us-east-1.amazonaws.com/releases/tower-runner/0.8.17/tower-runner_0.8.17-1_amd64.deb sudo dpkg -i tower-runner_0.8.17-1_amd64.deb ``` -------------------------------- ### Start SSE MCP Server for Legacy Clients Source: https://docs.tower.dev/docs/reference/mcp-server Start the MCP server with SSE transport for clients that do not support stdio. The server will be accessible at http://127.0.0.1:34567/sse. ```bash tower mcp-server --transport sse --port 34567 & ``` -------------------------------- ### Navigate and List Files Source: https://docs.tower.dev/docs/getting-started/quick-start Navigate into the 'hello-world' example directory and list its contents to verify files like Towerfile and task.py. ```bash cd ./01-hello-world cat Towerfile ``` ```bash cd ./01-hello-world ls ``` ```text Towerfile task.py ``` -------------------------------- ### C# Example for Get Team by Name Source: https://docs.tower.dev/docs/reference/api/describe-team Example of how to call the Get Team by Name endpoint using C# HttpClient. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.tower.dev/v1/teams/:name"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Complete Towerfile Example Source: https://docs.tower.dev/docs/reference/towerfile Defines an application named 'hello-world' with a Python script, source files, and two parameters. Ensure the script path is included in the source list. ```toml [app] name = "hello-world" script = "./task.py" # or "./task.sh" source = [ "./.dlt/config.toml", "./**/*.py", "./*.py", "requirements.txt", "./_data/*", "./task.sh", "./dlt_project.yml" ] [[parameters]] name = "param1" description = "First parameter" default = "some value" [[parameters]] name = "param2" description = "Second parameter" default = "another value" ``` -------------------------------- ### Create a new schedule Source: https://docs.tower.dev/docs/using-tower/orchestrate Example of creating a schedule for the 'hello-world' app, set to run every 15 minutes, with custom parameters. ```bash tower schedules create --app="hello-world" --cron="every 15 minutes" --parameter=friend=Brad --parameter=foe=Alice ``` -------------------------------- ### Local Run with Default Parameters Output Source: https://docs.tower.dev/docs/concepts/runs Example output from a local app run using default parameters, showing the execution with pre-defined values. ```text ✔ Getting secrets... Done! ✔ Building package... Done! Success! App `hello-world` has been launched 2024-11-20 16:39:47 | Hello, Steve! Boo to Carl 2024-11-20 16:39:48 | Hello, Steve! Boo to Carl 2024-11-20 16:39:49 | Hello, Steve! Boo to Carl 2024-11-20 16:39:50 | Hello, Steve! Boo to Carl 2024-11-20 16:39:51 | Hello, Steve! Boo to Carl Success! Your app exited cleanly. ``` -------------------------------- ### Get App Statistics (C#) Source: https://docs.tower.dev/docs/reference/api/generate-app-statistics Example of making a GET request to the app statistics endpoint using HttpClient in C#. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.tower.dev/v1/stats/apps"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Get Runners Request in C# Source: https://docs.tower.dev/docs/reference/api/list-runners Example of how to make a GET request to the /v1/runners endpoint using HttpClient in C#. Ensure you include the Accept and Authorization headers. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.tower.dev/v1/runners"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Running App with Parameters Source: https://docs.tower.dev/docs/reference/towerfile Command-line example to run a Tower app, specifying values for 'AWS_REGION' and 'iceberg_table' parameters. ```bash tower run \ --parameter=AWS_REGION='eu-central-1' \ --parameter=iceberg_table='default.japan_trade_stats_2017_2020' ``` -------------------------------- ### C# Example for Creating a Guest Source: https://docs.tower.dev/docs/reference/api/create-guest This C# code snippet demonstrates how to use HttpClient to send a POST request to create a guest. Ensure you include the Authorization header with your Bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://api.tower.dev/v1/guests"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var content = new StringContent("{\n \"app\": \"string\",\n \"expires_in\": 259200,\n \"name\": \"string\",\n \"redirect_url\": \"string\"\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Example Towerfile Configuration Source: https://docs.tower.dev/docs/architecture/how-tower-works Defines application name, entrypoint script, and source files to include in the Tower package. ```ini [app] name = "my-app" script = "./pipeline.py" source = [ "./**/*.py", "./*.py", "./requirements.txt" ] ``` -------------------------------- ### Local Run with Custom Parameters Output Source: https://docs.tower.dev/docs/concepts/runs Example output from a local app run with custom parameters, demonstrating the use of specified values for 'friend' and 'foe'. ```text ✔ Getting secrets... Done! ✔ Building package... Done! Success! App `hello-world` has been launched 2024-11-20 16:39:47 | Hello, Nick! Boo to nobody 2024-11-20 16:39:48 | Hello, Nick! Boo to nobody 2024-11-20 16:39:49 | Hello, Nick! Boo to nobody 2024-11-20 16:39:50 | Hello, Nick! Boo to nobody 2024-11-20 16:39:51 | Hello, Nick! Boo to nobody Success! Your app exited cleanly. ``` -------------------------------- ### GET Request for Run Statistics Source: https://docs.tower.dev/docs/reference/api/generate-run-statistics Use this GET request to retrieve statistics about runs over a specified time period. You can filter by status, start and end dates, timezone, and environment. ```http GET https://api.tower.dev/v1/stats/runs ``` -------------------------------- ### C# HttpClient Example for Get Encryption Key Source: https://docs.tower.dev/docs/reference/api/describe-secrets-key Example of how to use C#'s HttpClient to fetch the encryption key from the Tower API. Ensure you include the correct Authorization header with your Bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.tower.dev/v1/secrets/key"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Show help for creating a schedule Source: https://docs.tower.dev/docs/using-tower/orchestrate Use this command to view detailed options and usage for creating a new schedule. ```bash tower schedules create --help ``` -------------------------------- ### Create Environment using HttpClient in C# Source: https://docs.tower.dev/docs/reference/api/create-environment Example of creating an environment using HttpClient in C#. This includes setting the request method, URL, headers, and content. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://api.tower.dev/v1/environments"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var content = new StringContent("{\n \"name\": \"string\"\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### List Schedules Source: https://docs.tower.dev/docs/reference/api/list-schedules Use this endpoint to retrieve a list of all schedules associated with an application. No specific setup is required beyond making the HTTP GET request. ```http GET ## /schedules ``` -------------------------------- ### GET /v1/stats/runs Source: https://docs.tower.dev/docs/reference/api/generate-run-statistics Generates statistics about runs over a specified time period. You can filter runs by status, and specify a start and end date/time. A timezone can also be provided, defaulting to UTC. ```APIDOC ## GET /v1/stats/runs ### Description Generates statistics about runs over a specified time period. ### Method GET ### Endpoint https://api.tower.dev/v1/stats/runs ### Parameters #### Query Parameters - **status** (string[]) - Optional - Filter runs by status(es). Possible values: [`pending`, `running`, `crashed`, `errored`, `exited`, `cancelled`, `retrying`]. Define multiple with a comma-separated list. Supplying none will return all statuses. - **start_at** (date-time) - Required - Start date and time for statistics (inclusive). - **end_at** (date-time) - Required - End date and time for statistics (inclusive). - **timezone** (string) - Optional - Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to UTC. - **environment** (string) - Optional - Filter runs by environment. If not provided, all environments will be included. ### Responses #### Success Response (200) - **$schema** (string) - A URL to the JSON Schema for this object. - **series** (object[]) - Array of time series data points. - **cancelled** (integer) - Number of cancelled runs for the period. - **crashed** (integer) - Number of crashed runs for the period. - **errored** (integer) - Number of errored runs for the period. - **exited** (integer) - Number of exited runs for the period. - **pending** (integer) - Number of pending runs for the period. - **period** (string) - The period of the timeseries point, typically the start of the period. - **retrying** (integer) - Number of retrying runs for the period. - **running** (integer) - Number of running runs for the period. - **scheduled** (integer) - Number of scheduled runs for the period. - **settings** (object) - Settings used for the statistics query. - **end_at** (string) - The end time for the statistics period. - **environment** (string) - The environment to get statistics for. - **interval** (string) - The interval for the statistics period. Possible values: [`daily`, `hourly`]. - **start_at** (string) - The start time for the statistics period. - **timezone** (string) - The time zone for the statistics period. - **stats** (object) - Overall statistics. - **cancelled_runs** (integer) - Total cancelled runs. - **crashed_runs** (integer) - Total crashed runs. - **errored_runs** (integer) - Total errored runs. - **exited_runs** (integer) - Total exited runs. - **running_runs** (integer) - Total running runs. - **total_runs** (integer) - Total number of runs. #### Response Example (200 OK) ```json { "$schema": "string", "series": [ { "cancelled": 0, "crashed": 0, "errored": 0, "exited": 0, "pending": 0, "period": "2024-07-29T15:51:28.071Z", "retrying": 0, "running": 0, "scheduled": 0 } ], "settings": { "end_at": "2024-07-29T15:51:28.071Z", "environment": "string", "interval": "daily", "start_at": "2024-07-29T15:51:28.071Z", "timezone": "string" }, "stats": { "cancelled_runs": 0, "crashed_runs": 0, "errored_runs": 0, "exited_runs": 0, "running_runs": 0, "total_runs": 0 } } ``` #### Error Response (default) - **$schema** (string) - A URL to the JSON Schema for this object. - **detail** (string) - A human-readable explanation specific to this occurrence of the problem. - **errors** (object[]) - Optional list of individual error details. - **location** (string) - Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id'. - **message** (string) - Error message text. - **value** - The value at the given location. - **instance** (string) - A URI reference that identifies the specific occurrence of the problem. - **status** (integer) - HTTP status code. - **title** (string) - A short, human-readable summary of the problem type. This value should not change between occurrences of the error. - **type** (string) - A URI reference to human-readable documentation for the error. Default value: `about:blank`. #### Response Example (Error) ```json { "$schema": "string", "detail": "string", "errors": [ { "location": "string", "message": "string" } ], "instance": "string", "status": 0, "title": "string", "type": "about:blank" } ``` ``` -------------------------------- ### C# HttpClient Request with Bearer Token Source: https://docs.tower.dev/docs/reference/api/generate-run-statistics Example of making a GET request to the Tower API using C#'s HttpClient. Ensure you replace '' with your actual access token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.tower.dev/v1/stats/runs"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Create Catalog using C# HttpClient Source: https://docs.tower.dev/docs/reference/api/create-catalog Example of creating a catalog using C# and HttpClient. This snippet demonstrates setting headers, constructing the request body, and sending the POST request. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://api.tower.dev/v1/catalogs"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var content = new StringContent("{\n \"environment\": \"string\",\n \"name\": \"string\",\n \"properties\": [\n {\n \"encrypted_value\": \"string\",\n \"name\": \"string\",\n \"preview\": \"string\"\n }\n ],\n \"type\": \"snowflake-open-catalog\"\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Making Authenticated API Request in C# Source: https://docs.tower.dev/docs/reference/api/describe-team Example of how to make an authenticated GET request to the Tower API using HttpClient in C#. Ensure you replace '' with your actual access token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.tower.dev/v1/teams/:name"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### List Environments using C# HttpClient Source: https://docs.tower.dev/docs/reference/api/list-environments Example of how to list environments using C# HttpClient. Ensure you replace "" with your actual access token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.tower.dev/v1/environments"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Describe Webhook Request (C#) Source: https://docs.tower.dev/docs/reference/api/describe-webhook Example of how to make a GET request to the describe webhook endpoint using C#'s HttpClient. Ensure you include the correct authorization token and accept header. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.tower.dev/v1/webhooks/:name"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example for Tower API Source: https://docs.tower.dev/docs/reference/api/cancel-run This C# code snippet demonstrates how to use HttpClient to send a POST request to the Tower API to start an app run. Ensure you replace `` with your actual access token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://api.tower.dev/v1/apps/:name/runs/:seq"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example for Tower API Source: https://docs.tower.dev/docs/reference/api/list-runs This C# code snippet demonstrates how to use HttpClient to make a GET request to the Tower API to retrieve application runs. Ensure you replace `` with your actual access token. The code handles the response and prints the content to the console. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.tower.dev/v1/apps/:name/runs"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Create a New App in Tower Source: https://docs.tower.dev/docs/using-tower/develop Use this command to create a new application in Tower. Replace 'hello-world' with your desired app name. ```bash tower apps create --name="hello-world" ``` -------------------------------- ### Task Script Example Source: https://docs.tower.dev/docs/concepts/apps A Python script that prints 'Hello, world!' five times with a one-second delay between each print. This script is the core logic of the app. ```python import os import time count = 0 while count < 5: count += 1 print("Hello, world!") time.sleep(1) ``` -------------------------------- ### List Catalogs using HttpClient in C# Source: https://docs.tower.dev/docs/reference/api/list-catalogs Example of how to list catalogs using HttpClient in C#. Ensure you replace `` with your actual access token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.tower.dev/v1/catalogs"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Install Tower Runner via MSI on Windows Source: https://docs.tower.dev/docs/using-tower/self-hosted-runner-installation Install the Tower Runner using the downloaded MSI package. This command performs a quiet installation. ```powershell msiexec /i tower-runner.msi /qb ``` -------------------------------- ### Extract and Install Tower Runner via ZIP on Windows Source: https://docs.tower.dev/docs/using-tower/self-hosted-runner-installation Extract the Tower Runner ZIP archive to the desired installation directory and run the service installation script. ```powershell Expand-Archive -Path "tower-runner.zip" -DestinationPath "C:\Program Files\tower-runner" cd "C:\Program Files\tower-runner" ./install-service.ps1 ``` -------------------------------- ### Towerfile Configuration Source: https://docs.tower.dev/docs/getting-started/quick-start Example Towerfile defining an application's name, script, source files, and parameters. Parameters like 'friend' and 'foe' can be customized during execution. ```ini [app] name = "hello-world" script = "./task.py" source = [ "./task.py", ] [[parameters]] name = "friend" description = "Someone that is close to you." default = "Steve" [[parameters]] name = "foe" description = "Something that you'd prefer to avoid." default = "Carl" ``` -------------------------------- ### Acknowledge Alert C# Example Source: https://docs.tower.dev/docs/reference/api/acknowledge-alert Example of how to acknowledge an alert using HttpClient in C#. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://api.tower.dev/v1/alerts/:alert_seq/acknowledge"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Prompt: Deploy and Test App Source: https://docs.tower.dev/docs/getting-started/quickstart-with-mcp Use this prompt to have your AI assistant deploy the created application to Tower and run it with a test URL. ```plaintext Deploy this app to Tower and run it with a test URL ``` -------------------------------- ### Natural Language Schedule Examples Source: https://docs.tower.dev/docs/using-tower/orchestrate Examples of schedules written in a human-readable natural language format. ```plaintext every 15 minutes ``` ```plaintext every hour ```