MCP Tools Reference
Complete reference for all tools exposed by the Portabase MCP server.
The Portabase MCP server exposes 58 tools grouped into eight categories: Agents, Databases, Backups, Restorations, Channels, Policies, Organizations and Projects.
Agents
list_agents
List all agents accessible to the authenticated user.
Parameters: none
Returns: Array of agent objects.
get_agent
Get details for a specific agent, including its associated databases.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Agent ID |
Returns: Agent object with the databases you can access.
create_agent
Create a new agent, optionally scoped to an organization.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Agent name |
organizationId | string (UUID) | No | Organization ID to scope the agent to (optional) |
Returns: Created agent object.
delete_agent
Delete an agent by ID.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Agent ID |
Returns: Empty result on success.
get_agent_key
Get the edge key for an agent (used by the agent to authenticate with Portabase).
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Agent ID |
Returns: Edge key string.
list_organization_agents
List the agents attached to an organization.
| Parameter | Type | Required | Description |
|---|---|---|---|
organizationId | string | Yes | Organization ID |
Returns: Array of agent objects.
attach_agent_to_organization
Attach a global (system) agent to an organization. Requires system-admin privileges.
| Parameter | Type | Required | Description |
|---|---|---|---|
organizationId | string | Yes | Organization ID |
agentId | string | Yes | Agent ID (must be a global/unattached agent) |
Returns: { organizationId, agentId }.
detach_agent_from_organization
Detach an agent from an organization. Also unlinks that org's databases and removes their policies.
| Parameter | Type | Required | Description |
|---|---|---|---|
organizationId | string | Yes | Organization ID |
agentId | string | Yes | Agent ID |
Returns: { organizationId, agentId }.
Databases
list_databases
List all databases accessible to the authenticated user.
Parameters: none
Returns: Array of database objects.
create_database
Declare a database on an agent, like Add database on the agent page. The dashboard stores the configuration (secrets encrypted) and the agent receives it at its next ping.
| Parameter | Type | Required | Description |
|---|---|---|---|
agentId | string | Yes | Agent ID |
projectId | string | No | Project to attach the database to |
name | string | Yes | Display name |
dbms | string | Yes | Engine: postgresql, postgresql-cluster, mysql, mariadb, mongodb, sqlite, redis, valkey, firebird, mssql, docker-volume or files |
config | object | Yes | Connection settings, with the keys of a databases.json entry (host, port, username, password, database, options...). options.method picks the backup method of files and postgresql-cluster sources and cannot be changed later |
Returns: Database object, without its configuration.
Needs system admin rights for a global agent, or the right to manage agents in the agent's organization. Refused with 422 when the agent is too old for dashboard-defined sources (1.19.0), files sources (1.24.0) or the physical method (1.27.0).
get_database
Get details for a specific database.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Database ID |
Returns: Database object, with its own retentionPolicy (or null).
get_database_status
Get the current status of a database, including latest backup and restoration state.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Database ID |
Returns: { isWaitingForBackup, lastContact, latestBackup, latestRestoration }.
attach_database_to_project
Attach a database to a project. The database's agent must belong to the project's organization.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Database ID |
projectId | string | Yes | Target project ID |
Returns: Updated database object.
detach_database_from_project
Detach a database from its project. Clears its backup schedule and removes its retention, alert and storage policies.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Database ID |
Returns: Updated database object.
Backups
list_backups
List all backups for a specific database, ordered by most recent first.
| Parameter | Type | Required | Description |
|---|---|---|---|
databaseId | string | Yes | Database ID |
Returns: Array of backup objects.
get_backup
Get details for a specific backup, including its storage locations.
| Parameter | Type | Required | Description |
|---|---|---|---|
databaseId | string | Yes | Database ID |
backupId | string | Yes | Backup ID |
Returns: Backup object with a storages array. Use the id values from storages as backupStorageId in trigger_restore and get_backup_download_url.
trigger_backup
Trigger an immediate backup for a database. Refused if a backup is already waiting or running, or if backups are suspended because databases.json announces a different backup method. For a physical source, full: true takes a full backup that starts a new chain.
| Parameter | Type | Required | Description |
|---|---|---|---|
databaseId | string | Yes | Database ID |
full | boolean | No | Physical sources only: take a full backup instead of an incremental. Refused with 422 on other sources |
Returns: Backup job object.
Returns 409 Conflict if a backup is already waiting or running, or if backups are suspended (databases.json announces a different backup method).
delete_backup
Permanently delete a backup with its files and snapshots; replicas are kept (they are shared mirrors of the source). Cannot be undone.
| Parameter | Type | Required | Description |
|---|---|---|---|
databaseId | string | Yes | Database ID |
backupId | string | Yes | Backup ID |
Returns: Empty result on success.
This cannot be undone.
get_backup_logs
Get the job logs of a backup, oldest first.
| Parameter | Type | Required | Description |
|---|---|---|---|
databaseId | string | Yes | Database ID |
backupId | string | Yes | Backup ID |
Returns: Array of job log entries.
get_backup_download_url
Get a short-lived signed URL (about one minute) to download one stored copy of a backup. Snapshots and replicas cannot be downloaded.
| Parameter | Type | Required | Description |
|---|---|---|---|
databaseId | string | Yes | Database ID |
backupId | string | Yes | Backup ID |
backupStorageId | string | Yes | Backup storage ID (see get_backup) |
Returns: { url }.
The URL expires after about one minute; request a new one if it has expired.
Restorations
trigger_restore
Trigger a database restore from a specific backup storage. Use get_backup to find available backupStorageId values. Refused if a restore is already waiting or running, the backup file is missing, or the backup is a replica.
| Parameter | Type | Required | Description |
|---|---|---|---|
databaseId | string | Yes | Database ID |
backupId | string (UUID) | Yes | Backup ID |
backupStorageId | string (UUID) | Yes | Backup storage ID (from get_backup storages list) |
Returns: Restore job object.
Returns 409 Conflict if a restore is already waiting or running, if the backup file is missing, or if the backup is a sync/copy replica. Snapshots can be restored.
list_restorations
List the restorations of a database, most recent first.
| Parameter | Type | Required | Description |
|---|---|---|---|
databaseId | string | Yes | Database ID |
Returns: Array of restoration objects.
get_restoration_logs
Get the job logs of a restoration, oldest first.
| Parameter | Type | Required | Description |
|---|---|---|---|
databaseId | string | Yes | Database ID |
restorationId | string | Yes | Restoration ID |
Returns: Array of job log entries.
rerun_restoration
Requeue a finished restoration. Refused while any restoration of the database is waiting or ongoing, or when its backup is no longer available.
| Parameter | Type | Required | Description |
|---|---|---|---|
databaseId | string | Yes | Database ID |
restorationId | string | Yes | Restoration ID |
Returns: Requeued restoration object.
delete_restoration
Permanently delete a restoration record and its logs.
| Parameter | Type | Required | Description |
|---|---|---|---|
databaseId | string | Yes | Database ID |
restorationId | string | Yes | Restoration ID |
Returns: Empty result on success.
This cannot be undone.
Channels
Channel credentials (the config object) are write-only: no tool ever returns them.
list_storage_channels
List storage channels. With organizationId: the organization's own channels and the global ones assigned to it (owned: false). Without: global channels with their organizationIds (instance administrators).
| Parameter | Type | Required | Description |
|---|---|---|---|
organizationId | string | No | Organization ID for a channel owned by or assigned to that organization; omit for a global channel (instance administrators) |
Returns: Array of channel objects, without credentials.
get_storage_channel
Get one storage channel.
| Parameter | Type | Required | Description |
|---|---|---|---|
organizationId | string | No | Organization ID for a channel owned by or assigned to that organization; omit for a global channel (instance administrators) |
channelId | string | Yes | Channel ID |
Returns: Channel object, without credentials.
create_storage_channel
Create a storage channel: owned by the organization when organizationId is given, otherwise global (instance administrators; assign it with set_storage_channel_organizations).
| Parameter | Type | Required | Description |
|---|---|---|---|
organizationId | string | No | Organization ID for a channel owned by or assigned to that organization; omit for a global channel (instance administrators) |
name | string | Yes | 5–40 characters |
provider | string | Yes | s3, google-drive, blob, google-cloud-storage, rclone, sftp, local |
enabled | boolean | No | Defaults to true |
config | object | Yes | Provider settings, validated by the API; stored and never returned |
Returns: Created channel object, without credentials.
update_storage_channel
Update a channel. Omitted fields are kept; config, when given, replaces the whole stored config (send every field, secrets included). The provider can't change. A global channel can only be changed without organizationId, by an instance administrator.
| Parameter | Type | Required | Description |
|---|---|---|---|
organizationId | string | No | Organization ID for a channel owned by or assigned to that organization; omit for a global channel (instance administrators) |
channelId | string | Yes | Channel ID |
name | string | No | New name |
enabled | boolean | No | Enable or disable |
config | object | No | Complete new config |
Returns: Updated channel object, without credentials.
delete_storage_channel
Permanently delete a storage channel and its storage policies. Local storage channels can't be deleted. If backup copies are recorded on the channel, the call is refused unless force is true.
| Parameter | Type | Required | Description |
|---|---|---|---|
organizationId | string | No | Organization ID for a channel owned by or assigned to that organization; omit for a global channel (instance administrators) |
channelId | string | Yes | Channel ID |
force | boolean | No | Also delete when backup copies are recorded on the channel |
Returns: Empty result on success.
Forcing removes the records of those backup copies from Portabase; the files stay in the storage. This cannot be undone.
test_storage_channel
Check that Portabase can reach a stored storage channel.
| Parameter | Type | Required | Description |
|---|---|---|---|
organizationId | string | No | Organization ID for a channel owned by or assigned to that organization; omit for a global channel (instance administrators) |
channelId | string | Yes | Channel ID |
Returns: { success, message }, with credentials masked in the message.
set_storage_channel_organizations
Set which organizations may use a global storage channel (instance administrators). Replaces the list; removing an organization keeps its storage policies that already use the channel.
| Parameter | Type | Required | Description |
|---|---|---|---|
channelId | string | Yes | Channel ID |
organizationIds | string[] | Yes | Organization IDs; an empty list removes every assignment |
Returns: { organizationIds }
list_notification_channels
List notification channels. With organizationId: the organization's own channels and the global ones assigned to it (owned: false). Without: global channels with their organizationIds (instance administrators).
| Parameter | Type | Required | Description |
|---|---|---|---|
organizationId | string | No | Organization ID for a channel owned by or assigned to that organization; omit for a global channel (instance administrators) |
Returns: Array of channel objects, without credentials.
get_notification_channel
Get one notification channel.
| Parameter | Type | Required | Description |
|---|---|---|---|
organizationId | string | No | Organization ID for a channel owned by or assigned to that organization; omit for a global channel (instance administrators) |
channelId | string | Yes | Channel ID |
Returns: Channel object, without credentials.
create_notification_channel
Create a notification channel: owned by the organization when organizationId is given, otherwise global (instance administrators; assign it with set_notification_channel_organizations).
| Parameter | Type | Required | Description |
|---|---|---|---|
organizationId | string | No | Organization ID for a channel owned by or assigned to that organization; omit for a global channel (instance administrators) |
name | string | Yes | 5–40 characters |
provider | string | Yes | slack, smtp, discord, telegram, gotify, ntfy, webhook, nextcloud, teams, pushover, apprise, healthchecks |
enabled | boolean | No | Defaults to true |
config | object | Yes | Provider settings, validated by the API; stored and never returned |
Returns: Created channel object, without credentials.
update_notification_channel
Update a channel. Omitted fields are kept; config, when given, replaces the whole stored config (send every field, secrets included). The provider can't change. A global channel can only be changed without organizationId, by an instance administrator.
| Parameter | Type | Required | Description |
|---|---|---|---|
organizationId | string | No | Organization ID for a channel owned by or assigned to that organization; omit for a global channel (instance administrators) |
channelId | string | Yes | Channel ID |
name | string | No | New name |
enabled | boolean | No | Enable or disable |
config | object | No | Complete new config |
Returns: Updated channel object, without credentials.
delete_notification_channel
Permanently delete a notification channel and its alert policies.
| Parameter | Type | Required | Description |
|---|---|---|---|
organizationId | string | No | Organization ID for a channel owned by or assigned to that organization; omit for a global channel (instance administrators) |
channelId | string | Yes | Channel ID |
Returns: Empty result on success.
This cannot be undone.
test_notification_channel
Send a real test notification through a stored notification channel.
| Parameter | Type | Required | Description |
|---|---|---|---|
organizationId | string | No | Organization ID for a channel owned by or assigned to that organization; omit for a global channel (instance administrators) |
channelId | string | Yes | Channel ID |
Returns: { success, message }, with credentials masked in the message.
set_notification_channel_organizations
Set which organizations may use a global notification channel (instance administrators). Replaces the list; removing an organization keeps its alert policies that already use the channel.
| Parameter | Type | Required | Description |
|---|---|---|---|
channelId | string | Yes | Channel ID |
organizationIds | string[] | Yes | Organization IDs; an empty list removes every assignment |
Returns: { organizationIds }
Policies
set_database_backup_policy
Set or clear a database's backup schedule. Provide a cron expression, or an empty string to clear it (which also drops the retention policy).
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Database ID |
backupPolicy | string | Yes | A valid cron expression, or an empty string to clear the schedule |
Returns: Updated database object.
set_project_backup_policy
Set or clear a project's default backup schedule, inherited by its databases that have none. Provide a cron expression, or an empty string to clear it (which also drops the project's retention policy).
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Project ID |
backupPolicy | string | Yes | A valid cron expression, or an empty string to clear the schedule |
Returns: Updated project object.
set_database_full_backup_policy
Physical sources only: set or clear the full backup schedule. The first backup at or after each occurrence is a full one that starts a new chain; the schedule never starts a backup by itself. While it is set, the agent's full_every_days is not applied.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Database ID |
fullBackupPolicy | string | Yes | A 5-field cron expression (minute hour day-of-month month day-of-week), or an empty string to clear the schedule |
Returns: Updated database object.
set_database_retention_policy
Create or update a database's own retention policy (overrides the project's). The database must have its own backup schedule.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Database ID |
type | string | No | count, days or gfs (default gfs) |
count | number | Yes | Backups kept when type is count (1–100) |
days | number | Yes | Days kept when type is days (1–3650) |
gfs | object | Yes | { hourly, daily, weekly, monthly, yearly } copies kept when type is gfs |
Returns: Retention policy object.
Returns 409 Conflict if the database has no backup schedule of its own.
set_project_retention_policy
Create or update a project's retention policy, inherited by its databases that have none. The project must have its own backup schedule.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Project ID |
type | string | No | count, days or gfs (default gfs) |
count | number | Yes | Backups kept when type is count (1–100) |
days | number | Yes | Days kept when type is days (1–3650) |
gfs | object | Yes | { hourly, daily, weekly, monthly, yearly } copies kept when type is gfs |
Returns: Retention policy object.
Returns 409 Conflict if the project has no backup schedule of its own.
get_database_storage_policies
List the database's own storage policies. An empty list makes the database use its project's policies.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Database ID |
Returns: Array of policies with their channel (id, name, provider, enabled).
set_database_storage_policies
Replace all storage policies of a database with the given list. To add or remove one channel, call get_database_storage_policies first and send the edited list. An empty list makes the database use its project's policies. With no enabled storage policy left, backups go to the instance's default storage.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Database ID |
policies | array | Yes | Complete list [{ storageChannelId, enabled? }]; every channel must be usable by the organization. |
Returns: The new list of policies.
get_database_alert_policies
List the database's own alert policies. An empty list makes the database use its project's policies.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Database ID |
Returns: Array of policies with their channel (id, name, provider, enabled).
set_database_alert_policies
Replace all alert policies of a database with the given list. To add or remove one channel, call get_database_alert_policies first and send the edited list. An empty list makes the database use its project's policies.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Database ID |
policies | array | Yes | Complete list [{ notificationChannelId, eventKinds, enabled? }]; every channel must be usable by the organization. Events: error_backup, success_backup, error_health_database, error_backup_missing, success_backup_recovered, error_restore, success_restore. |
Returns: The new list of policies.
get_project_storage_policies
List the project's own storage policies.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Project ID |
Returns: Array of policies with their channel (id, name, provider, enabled).
set_project_storage_policies
Replace all storage policies of a project with the given list. To add or remove one channel, call get_project_storage_policies first and send the edited list. With no enabled storage policy left, backups go to the instance's default storage.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Project ID |
policies | array | Yes | Complete list [{ storageChannelId, enabled? }]; every channel must be usable by the organization. |
Returns: The new list of policies.
get_project_alert_policies
List the project's own alert policies.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Project ID |
Returns: Array of policies with their channel (id, name, provider, enabled).
set_project_alert_policies
Replace all alert policies of a project with the given list. To add or remove one channel, call get_project_alert_policies first and send the edited list.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Project ID |
policies | array | Yes | Complete list [{ notificationChannelId, eventKinds, enabled? }]; every channel must be usable by the organization. Events: error_backup, success_backup, error_health_database, error_backup_missing, success_backup_recovered, error_restore, success_restore. |
Returns: The new list of policies.
Organizations
list_organizations
List organizations the authenticated user belongs to.
Parameters: none
Returns: Array of organization objects.
get_organization
Get details for a specific organization.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Organization ID |
Returns: Organization object.
create_organization
Create a new organization; the authenticated user becomes its owner.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Organization name |
slug | string | No | Optional slug (defaults to a slugified name) |
Returns: Created organization object.
delete_organization
Delete an organization. Fails if it is the default organization or still has projects.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Organization ID |
Returns: { id } of the deleted organization.
Projects
list_projects
List the projects of an organization.
| Parameter | Type | Required | Description |
|---|---|---|---|
organizationId | string | Yes | Organization ID |
Returns: Array of project objects.
create_project
Create a new project within an organization.
| Parameter | Type | Required | Description |
|---|---|---|---|
organizationId | string | Yes | Organization ID |
name | string | Yes | Project name |
slug | string | No | Optional slug (defaults to a slugified name) |
Returns: Created project object.
get_project
Get details for a specific project.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Project ID |
Returns: Project object, with its retentionPolicy (or null).
archive_project
Archive a project. Detaches its databases (clearing their schedule) and removes their policies.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Project ID |
Returns: Archived project object.
Last updated on