Skip to main content
Glama

OpenFactory

add_app_database

Provision a managed Postgres database for an app + publish DATABASE_URL into the app's env automatically.

M1 behavior:

  1. Verify caller owns the app

  2. POST to libvirt :8001 /api/app-infra/databases to allocate the DB (stub mode by default — no real Postgres VM needed for M1)

  3. PUT DATABASE_URL into the app's env via the producer API (the password never crosses MCP back to the caller)

  4. Append db_id to App.db_refs

  5. Return {db_id, status, env_keys, env_published}

When OPENFACTORY_DB_PRODUCER_TOKEN is unset, step 3 is skipped and the connection URL is returned in the response — the caller must publish it manually via set_app_env(app_id, set={'DATABASE_URL': ...}).

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": {
      "app_id": "<app_id>"
    },
    "name": "add_app_database"
  }
}

Input Schema

NameRequiredDescriptionDefault
app_idYesApp ID (UUID from create_app).
engineNoDB engine. M1 supports 'postgres' only; MySQL+Redis are M3.postgres
api_keyNoMCP API key
session_tokenNoSession token

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does well: it enumerates the five execution steps, discloses the security-relevant detail that the password never crosses MCP back to the caller, and flags the stub-mode/token-unset behavior branch. It leaves out whether repeated calls create duplicate databases or overwrite an existing DATABASE_URL, and what permissions are required beyond app ownership.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the outcome in sentence one, then a compact numbered pipeline. Every step conveys non-obvious behavior; only the M1 milestone vocabulary is slightly heavier than needed for an agent deciding to call it.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Output schema exists, yet the description still names the return keys ({db_id, status, env_keys, env_published}) for at-a-glance confirmation, and the two execution modes are both covered. The main residual gap is failure/idempotency semantics for a mutating provisioning call.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, and the description adds real meaning on top: engine is constrained to postgres in M1 with MySQL/Redis deferred, and app_id ties to create_app. The auth parameters are untouched but already documented in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb and resource: 'Provision a managed Postgres database for an app + publish DATABASE_URL into the app's env.' It is clearly distinguishable from list_app_databases (read) and add_app_bucket (different resource), so an agent can select it without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete operational context: stub mode by default in M1, and an explicit fallback path — when OPENFACTORY_DB_PRODUCER_TOKEN is unset, the caller must publish the URL manually via set_app_env. It names a sibling and the condition that selects it, though it does not state when to prefer this over other provisioning paths or whether repeats are allowed.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.