Skip to main content
Glama

Attach a resource to an app

attach_resource
Idempotent

Attach a resource to an app: a named set of environment variables, such as a database's connection string, that the app reads as secrets. Name the resource. When the organization has none by that name, pass a provider from list_catalog_resources and the first call creates it, returning at once with state provisioning. Call again with the same arguments, env_prefix included, until the state is attached: the call that finds the resource ready attaches it and sets its variables, restarting the app if it is running. An existing resource attaches by name alone, including one another app holds. The call is safe to repeat: one name is one resource however many times it is called, and an app can hold several under different names. Pass env_prefix when two resources would set the same variables. Read the names an attachment sets from list_catalog_resources before writing the app's code. A new database is empty, so the app creates its own tables, and its URL carries the TLS settings it needs. The app must exist, so publish it first. After the attach restarts it, get_service shows whether it is running again. Provisioning takes about a minute; call again every ten seconds. Values are never returned here. Requires connecting a Valet account.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesRequired. The app's name.
planNoThe provider's plan. Omit to use its first plan. Repeat it on every call for one resource.
org_nameNoThe Valet organization the app belongs to. Omit to use the organization the account joined first.
providerNoThe provider to create the resource from, from list_catalog_resources. Required when the organization has no resource by this name.
resourceYesRequired. The resource's name in the organization, such as shop-db: 3 to 63 lowercase letters, digits, and hyphens. Repeat it on every call for one resource.
env_prefixNoSet the resource's variables under PREFIX_NAME rather than NAME: an uppercase letter, then up to 31 uppercase letters, digits, and underscores. Omit to use the names as they are. Repeat it on every call for one resource: it applies on the call that attaches.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / provider / description
      Previous value: -"The provider to create the resource from, from list_resource_catalog. Required when the organization has no resource by this name."New value: +"The provider to create the resource from, from list_catalog_resources. Required when the organization has no resource by this name."
  2. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare idempotentHint=true and destructiveHint=false, but the description adds substantial context the annotations cannot: the asynchronous provisioning state machine (call again until state is 'attached'), the ~1 minute / 10-second polling cadence, that variables are set only on the attaching call, that the app restarts, that values are never returned, and that a Valet account is required.

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?

The purpose and the create-vs-attach branching are front-loaded and every sentence carries operative detail, so the length is largely earned for an async, idempotent provisioning tool. It is still dense with ~14 sentences, and the aside about a new database being empty and the app creating its own tables is helpful but skippable, keeping it just short of 5.

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

Completeness5/5

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

With no output schema, the description compensates by explaining what the call returns at each stage ('returning at once with state provisioning', the attaching call, values never returned) and where to verify the outcome. For a 6-parameter, open-world, multi-call workflow, an agent has everything needed to sequence the calls correctly.

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 baseline is 3, but the description goes beyond the schema by explaining when provider is mandatory, what env_prefix is for (colliding variable names), and the invariant that plan, resource, and env_prefix must be repeated identically on every call for one resource. That repetition requirement is a real semantic constraint not obvious from the parameter list.

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?

The description opens with a precise verb+resource and immediately defines what a 'resource' is ('a named set of environment variables, such as a database's connection string, that the app reads as secrets'), which no sibling name conveys. This clearly separates it from attach_channel, attach_connector, attach_skill, and detach/destroy_resource.

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

Usage Guidelines5/5

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

It states explicit conditions for each path: pass a provider from list_catalog_resources when the org has no resource by that name, attach by name alone when one exists, pass env_prefix when two resources would collide, and publish the app first because it must exist. It also routes the agent to get_service to confirm the restart and to list_catalog_resources for the variable names.

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.

Resources