Add database
add_databaseGive a spawnpoint project its own Postgres database. The database is created on spawnpoint's managed server and the app is restarted with DATABASE_URL set (persisted like any env var, so it survives redeploys); the app connects with any Postgres client library and creates its own tables. Idempotent: calling it again returns the same database. Use it when the app needs real relational storage that outlives its machine; for a SQLite file or uploads, the persistent data directory (SPAWNPOINT_DATA_DIR) needs no call at all. Refused if the user already set a DATABASE_URL of their own. When the project is terminated the database is kept for 7 days, restorable from the console into a project deployed under the same name, then dropped. While get_project shows database.backups, spawnpoint copies it every night, kept 30 days (7 on the Free plan); no tool restores a copy: to get back data lost to a bad migration or a delete, give the user backups.restore_url, where they restore a night.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project_id": "<project_id>"
},
"name": "add_database"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | the id of the project |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | ||
| note | Yes | ||
| status | Yes | ||
| database | No | ||
| project_id | Yes |