Digital ocean

Learn how to use Digital ocean with Composio

Overview

SLUG: DIGITAL_OCEAN

Description

DigitalOcean is a cloud infrastructure provider offering scalable compute platforms with a user-friendly interface.

Authentication Details

client_id
stringRequired
client_secret
stringRequired
oauth_redirect_uri
stringDefaults to https://backend.composio.dev/api/v1/auth-apps/add
scopes
stringDefaults to read
bearer_token
string
bearer_token
stringRequired

Connecting to Digital ocean

Create an auth config

Use the dashboard to create an auth config for the Digital ocean toolkit. This allows you to connect multiple Digital ocean accounts to Composio for agents to use.

1

Select App

Navigate to [Digital ocean](https://platform.composio.dev/marketplace/Digital ocean).

2

Configure Auth Config Settings

Select among the supported auth schemes of and configure them here.

3

Create and Get auth config ID

Click “Create Digital ocean Auth Config”. After creation, copy the displayed ID starting with ac_. This is your auth config ID. This is not a sensitive ID — you can save it in environment variables or a database. This ID will be used to create connections to the toolkit for a given user.

Connect Your Account

Using OAuth2

1from composio import Composio
2
3# Replace these with your actual values
4digital_ocean_auth_config_id = "ac_YOUR_DIGITAL_OCEAN_CONFIG_ID" # Auth config ID created above
5user_id = "0000-0000-0000" # UUID from database/application
6
7composio = Composio()
8
9
10def authenticate_toolkit(user_id: str, auth_config_id: str):
11 connection_request = composio.connected_accounts.initiate(
12 user_id=user_id,
13 auth_config_id=auth_config_id,
14 )
15
16 print(
17 f"Visit this URL to authenticate Digital ocean: {connection_request.redirect_url}"
18 )
19
20 # This will wait for the auth flow to be completed
21 connection_request.wait_for_connection(timeout=15)
22 return connection_request.id
23
24
25connection_id = authenticate_toolkit(user_id, digital_ocean_auth_config_id)
26
27# You can also verify the connection status using:
28connected_account = composio.connected_accounts.get(connection_id)
29print(f"Connected account: {connected_account}")

Using API Key

1from composio import Composio
2
3# Replace these with your actual values
4digital_ocean_auth_config_id = "ac_YOUR_DIGITAL_OCEAN_CONFIG_ID" # Auth config ID created above
5user_id = "0000-0000-0000" # UUID from database/app
6
7composio = Composio()
8
9def authenticate_toolkit(user_id: str, auth_config_id: str):
10 # Replace this with a method to retrieve an API key from the user.
11 # Or supply your own.
12 user_api_key = input("[!] Enter API key")
13
14 connection_request = composio.connected_accounts.initiate(
15 user_id=user_id,
16 auth_config_id=auth_config_id,
17 config={"auth_scheme": "API_KEY", "val": user_api_key}
18 )
19
20 # API Key authentication is immediate - no redirect needed
21 print(f"Successfully connected Digital ocean for user {user_id}")
22 print(f"Connection status: {connection_request.status}")
23
24 return connection_request.id
25
26
27connection_id = authenticate_toolkit(user_id, digital_ocean_auth_config_id)
28
29# You can verify the connection using:
30connected_account = composio.connected_accounts.get(connection_id)
31print(f"Connected account: {connected_account}")

Tools

Executing tools

To prototype you can execute some tools to see the responses and working on the [Digital ocean toolkit’s playground](https://app.composio.dev/app/Digital ocean)

Python
1from composio import Composio
2from openai import OpenAI
3import json
4
5openai = OpenAI()
6composio = Composio()
7
8# User ID must be a valid UUID format
9user_id = "0000-0000-0000" # Replace with actual user UUID from your database
10
11tools = composio.tools.get(user_id=user_id, toolkits=["DIGITAL_OCEAN"])
12
13print("[!] Tools:")
14print(json.dumps(tools))
15
16def invoke_llm(task = "What can you do?"):
17 completion = openai.chat.completions.create(
18 model="gpt-4o",
19 messages=[
20 {
21 "role": "user",
22 "content": task, # Your task here!
23 },
24 ],
25 tools=tools,
26 )
27
28 # Handle Result from tool call
29 result = composio.provider.handle_tool_calls(user_id=user_id, response=completion)
30 print(f"[!] Completion: {completion}")
31 print(f"[!] Tool call result: {result}")
32
33invoke_llm()

Tool List

Tool Name: Create Custom Image

Description

Tool to create a new custom image by providing a url to a linux vm image. use when you need to import a vm image into digitalocean after specifying name, url, distribution, and region.

Action Parameters

description
string
distribution
stringRequired
name
stringRequired
region
stringRequired
tags
array
url
Required

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Database Cluster

Description

Tool to create a new managed database cluster. use when you need to provision a database cluster with name, engine, version, region, size, and number of nodes.

Action Parameters

backup_restore
object
db_names
array
engine
stringRequired
eviction_policy
string
maintenance_window
object
name
stringRequired
num_nodes
integerRequired
private_network_uuid
string
region
stringRequired
size
stringRequired
sql_mode
string
storage_size_gb
integer
tags
array
user_names
array
version
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create New Block Storage Volume

Description

Tool to create a new block storage volume. use when you need to provision persistent block storage after confirming the target region supports volumes. example: "create a 100 gib ext4 backup volume named 'db-backup' in nyc1."

Action Parameters

description
string
filesystem_label
string
filesystem_type
string
name
stringRequired
region
stringRequired
size_gigabytes
integerRequired
snapshot_id
string
tags
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create New Domain

Description

Tool to create a new domain. use when you have the domain name and optionally an ip address to assign an a record.

Action Parameters

ip_address
string
name
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Domain Record

Description

Tool to create a new dns record for a domain. use after confirming domain exists and record specifics.

Action Parameters

data
stringRequired
domain_name
stringRequired
flags
integer
name
string
port
integer
priority
integer
tag
string
ttl
integer
type
stringRequired
weight
integer

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create New Droplet

Description

Tool to create a new droplet. use when you need to provision a vm with name, region, size, and image.

Action Parameters

backups
boolean
image
stringRequired
ipv6
boolean
monitoring
boolean
name
stringRequired
private_networking
boolean
region
stringRequired
size
stringRequired
ssh_keys
array
tags
array
user_data
string
volumes
array
vpc_uuid
string
with_droplet_agent
boolean

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create New Firewall

Description

Tool to create a new firewall. use when you need to define a firewall name and custom rules (requires at least one inbound and one outbound rule).

Action Parameters

droplet_ids
array
inbound_rules
arrayRequired
name
stringRequired
outbound_rules
arrayRequired
tags
array
vpc_uuid
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create New Kubernetes Cluster

Description

Tool to create a new kubernetes cluster. use when you have finalized the cluster name, region, version, and at least one node pool. confirm region supports kubernetes clusters before use.

Action Parameters

auto_upgrade
boolean
maintenance_policy
object
name
stringRequired
node_pools
arrayRequired
region
stringRequired
tags
array
version
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create New Load Balancer

Description

Tool to create a new load balancer. use after specifying region, forwarding rules, and targets.

Action Parameters

algorithm
string
droplet_ids
array
enable_backend_keepalive
boolean
enable_proxy_protocol
boolean
firewall_policy
string
forwarding_rules
arrayRequired
health_check
object
name
stringRequired
redirect_http_to_https
boolean
region
stringRequired
sticky_sessions
object
tag
string
vpc_uuid
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create New SSH Key

Description

Tool to create a new ssh key. use when you need to register a public key to access droplets.

Action Parameters

name
stringRequired
public_key
Required

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create New Tag

Description

Tool to create a new tag. use when you need to organize resources by grouping them under a custom tag. ensure the tag name passes validation before calling. example: "create a new tag named analytics".

Action Parameters

name
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create New VPC

Description

Tool to create a new vpc. use when you need to provision a private network in a specific region.

Action Parameters

description
string
ip_range
string
name
stringRequired
region
stringRequired
tags
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Block Storage Volume

Description

Tool to delete a block storage volume by id. use when you need to permanently remove an existing block storage volume after confirming its id. returns http 204 no content on success.

Action Parameters

region
string
volume_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Database Cluster

Description

Tool to delete a database cluster by uuid. use when you have confirmed the cluster is no longer needed. returns http 204 no content on success.

Action Parameters

database_cluster_uuid
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Domain

Description

Tool to delete a domain by name. use when you have confirmed the domain has no records assigned. returns 204 no content on success.

Action Parameters

name
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Domain Record

Description

Tool to delete a dns record by its record id for a domain. use when you need to remove an existing dns record and have the domain name and record id. returns http 204 no content on success.

Action Parameters

name
stringRequired
record_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Existing Droplet

Description

Tool to delete a droplet by id. use when you need to permanently remove an existing droplet after confirming its id to avoid unintended deletions.

Action Parameters

droplet_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Firewall

Description

Tool to delete a firewall by id. use when you have confirmed the firewall is no longer needed.

Action Parameters

firewall_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Image

Description

Tool to delete a snapshot or custom image by id. use when cleaning up unused images after confirming there are no dependents.

Action Parameters

image_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Load Balancer

Description

Tool to delete a load balancer instance by id. use when you need to permanently remove an existing load balancer after confirming its id. returns 204 no content on success.

Action Parameters

load_balancer_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete SSH Key

Description

Tool to delete a public ssh key. use when you need to remove an ssh key from your account by its id or fingerprint after confirming its ownership. returns 204 no content on success.

Action Parameters

key_id_or_fingerprint
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Tag

Description

Tool to delete a tag by name. use when you need to untag all resources previously tagged. returns 204 no content on success.

Action Parameters

name
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete VPC

Description

Tool to delete a vpc by its id. use when you need to remove an existing virtual private cloud. returns 204 no content on success.

Action Parameters

vpc_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List All Databases

Description

Tool to list all managed database clusters on your account. use when you need to retrieve clusters and support pagination or filtering by tag.

Action Parameters

page
integer
per_page
integer
tag_name
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List All Domains

Description

Tool to list all domains in your digitalocean account. use when you need to retrieve or iterate through domains, with optional pagination. use after authentication.

Action Parameters

page
integer
per_page
integer

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List All Droplets

Description

Tool to list all droplets in your account. use when you need an overview of droplets, optionally filtered by tag. use after authentication.

Action Parameters

page
integerDefaults to 1
per_page
integerDefaults to 20
tag_name
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List All Firewalls

Description

Tool to list all firewalls on your digitalocean account. use when you need to audit or manage firewall rules with optional pagination.

Action Parameters

page
integer
per_page
integer

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List All Images

Description

Tool to list all images available on your account. use after obtaining a valid api token to retrieve images optionally filtered by type, private visibility, or tag name.

Action Parameters

page
integer
per_page
integer
private
boolean
tag_name
string
type
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List All Kubernetes Clusters

Description

Tool to list all kubernetes clusters on your account. use when you need to enumerate every cluster and handle pagination.

Action Parameters

page
integer
per_page
integer

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List All Load Balancers

Description

Tool to list all load balancer instances on your account. use when you need a paginated overview of load balancers after authentication.

Action Parameters

page
integerDefaults to 1
per_page
integerDefaults to 20

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List All Snapshots

Description

Tool to list all snapshots available on your digitalocean account. use when you need to fetch and optionally filter snapshots by resource type (droplet or volume) and handle pagination for inventory or backup workflows.

Action Parameters

page
integer
per_page
integer
resource_type
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List All SSH Keys

Description

Tool to list all ssh keys in your account. use when you need to retrieve ssh key metadata.

Action Parameters

page
integer
per_page
integer

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List All Tags

Description

Tool to list all tags in your account. use when you need to retrieve available tags and pagination info.

Action Parameters

page
integer
per_page
integer

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List All Volumes

Description

Tool to list all block storage volumes available on your account. use when you need to retrieve volumes and optionally filter by name and region.

Action Parameters

name
string
page
integer
per_page
integer
region
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List All VPCs

Description

Tool to list all vpcs on your account. use when you need an inventory of your vpc resources; supports pagination.

Action Parameters

page
integer
per_page
integer

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Database Options

Description

Tool to list valid database engine, version, region, and size options. use when configuring a new managed database cluster.

Action Parameters

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Domain Records

Description

Tool to list all dns records for a domain. use when you need to inspect or filter a domain's dns configuration.

Action Parameters

name
stringRequired
page
integer
per_page
integer
type
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Retrieve Domain

Description

Tool to retrieve details about a specific domain by its name. use after creating or importing a domain to verify ttl and zone file configuration.

Action Parameters

name
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Retrieve Domain Record

Description

Tool to retrieve a specific dns record for a domain by its record id. use when you have the domain name and record id to fetch record details.

Action Parameters

name
stringRequired
record_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Retrieve Existing Droplet

Description

Tool to show information about an individual droplet by id. use when you have a droplet id and need detailed status.

Action Parameters

droplet_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Retrieve Existing Image

Description

Tool to retrieve information about an image by id or slug. use when you need detailed metadata for a known image.

Action Parameters

image_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Retrieve Tag

Description

Tool to retrieve an individual tag by name. use when you need to inspect the resources grouped under a specific tag.

Action Parameters

name
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Retrieve VPC

Description

Tool to retrieve details about a specific vpc by its id. use when you need to inspect vpc properties for configuration or auditing.

Action Parameters

vpc_uuid
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Tag Resource

Description

Tool to tag resources by name. use when you need to assign an existing tag to one or more resources. returns 204 no content on success.

Action Parameters

resources
arrayRequired
tag_name
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Untag Resource

Description

Tool to untag resources by tag name. use when you need to remove an existing tag from multiple resources in a single operation.

Action Parameters

resources
arrayRequired
tag_name
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update Domain Record

Description

Tool to update an existing dns record for a domain. use when you need to modify any valid attribute of a record after confirming its record id.

Action Parameters

data
string
domain_name
stringRequired
flags
integer
name
string
port
integer
priority
integer
record_id
integerRequired
tag
string
ttl
integer
type
string
weight
integer

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update VPC

Description

Tool to update information about a vpc. use when you need to modify the name, description, or default status of an existing vpc.

Action Parameters

default
boolean
description
string
name
string
vpc_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired