Skip to main content
Glama

Grant machine to project

grant_machines_add

Lets a project's agent configs use one BYO machine by name and returns the grant with the machine's record. Pooled machines can't be granted this way and return 404. Idempotency keys are retained only while the grant exists. Retrying creation after the grant is revoked or deleted can recreate it and restore access, including through automatic SDK retries. A replay compares the request with the current grant.

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": {
      "machine_id": "<machine_id>",
      "orgID": "<orgID>",
      "projectID": "<projectID>"
    },
    "name": "grant_machines_add"
  }
}

Input Schema

NameRequiredDescriptionDefault
orgIDYesOrganization ID (org_...).
metadataNoArbitrary key-value labels stored with the resource.
projectIDYesProject ID (proj_...).
machine_idYesMachine ID (mch_...).
descriptionNoFree-form note stored with the grant.

Output Schema

NameRequiredDescriptionDefault
grantYes
machineYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • changedInput schema / properties / description / description
      Previous value: -"Optional note about this grant."New value: +"Free-form note stored with the grant."
    • changedInput schema / properties / metadata / description
      Previous value: -"Arbitrary key-value metadata. Maximum 16 pairs, keys up to 64 characters, values must be strings of up to 512 characters."New value: +"Arbitrary key-value labels stored with the resource."
    • removedInput schema / properties / metadata / x-go-type
      Removed value: -"resourcemeta.Metadata"
    • removedInput schema / properties / metadata / x-go-type-import
      Removed value: -{
      -  "path": "github.com/omnara-ai/omnara/internal/resourcemeta"
      -}
    • removedInput schema / properties / metadata / x-go-type-skip-optional-pointer
      Removed value: -true
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$defs": {
      +    "Machine": {
      +      "properties": {
      +        "connection_state": {
      +          "$ref": "#/$defs/MachineConnectionState",
      +          "description": "Whether the machine's daemon is connected now; asleep means suspended but able to be woken."
      +        },
      +        "connection_state_reason": {
      +          "description": "Why the machine's latest daemon session ended, such as daemon_lease_expired.",
      +          "type": "string"
      +        },
      +        "created_at": {
      +          "$ref": "#/$defs/Timestamp",
      +          "description": "When the machine record was created."
      +        },
      +        "cwd": {
      +          "description": "Default working directory for processes started on the machine.",
      +          "type": "string"
      +        },
      +        "delete_attempts": {
      +          "description": "Number of times Omnara has tried to delete this machine.",
      +          "format": "int32",
      +          "type": "integer"
      +        },
      +        "deleted_at": {
      +          "anyOf": [
      +            {
      +              "$ref": "#/$defs/Timestamp"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "description": "When the machine finished deleting; null while it still exists."
      +        },
      +        "description": {
      +          "description": "Free-form note about the machine; empty if none was set.",
      +          "type": "string"
      +        },
      +        "display_name": {
      +          "$ref": "#/$defs/ResourceName",
      +          "description": "Machine name; agent configs reference a BYO machine by this as machine_name."
      +        },
      +        "env": {
      +          "additionalProperties": {
      +            "type": "string"
      +          },
      +          "description": "Environment variables set for every process started on the machine.",
      +          "type": "object"
      +        },
      +        "failure_report": {
      +          "$ref": "#/$defs/MachineFailureReport",
      +          "description": "Latest setup or daemon failure reported from the machine; omitted when none is recorded."
      +        },
      +        "id": {
      +          "$ref": "#/$defs/MachineID",
      +          "description": "Identifies the machine."
      +        },
      +        "last_observed_at": {
      +          "anyOf": [
      +            {
      +              "$ref": "#/$defs/Timestamp"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "description": "When the daemon last registered or sent a heartbeat; null if it has never connected."
      +        },
      +        "lifecycle_reason_code": {
      +          "description": "Machine-readable reason for the latest lifecycle change, such as idle_timeout; empty when none.",
      +          "type": "string"
      +        },
      +        "lifecycle_reason_message": {
      +          "description": "Human-readable detail for lifecycle_reason_code; empty when none.",
      +          "type": "string"
      +        },
      +        "lifecycle_state": {
      +          "$ref": "#/$defs/MachineLifecycleState",
      +          "description": "Where the machine is in provisioning or deletion, independent of whether its daemon is connected."
      +        },
      +        "machine_pool_id": {
      +          "anyOf": [
      +            {
      +              "$ref": "#/$defs/MachinePoolID"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "description": "Pool the machine was created from; null for BYO machines."
      +        },
      +        "metadata": {
      +          "$ref": "#/$defs/Metadata",
      +          "description": "Key-value metadata attached to the machine."
      +        },
      +        "next_reconcile_after": {
      +          "anyOf": [
      +            {
      +              "$ref": "#/$defs/Timestamp"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "description": "When Omnara next works on provisioning or deleting the machine; null when nothing is scheduled."
      +        },
      +        "org_id": {
      +          "$ref": "#/$defs/OrganizationID",
      +          "description": "Organization that owns the machine."
      +        },
      +        "provider": {
      +          "description": "Sandbox provider that hosts a pool machine; byo for bring-your-own machines.",
      +          "type": "string"
      +        },
      +        "provision_attempts": {
      +          "description": "Number of times Omnara has tried to provision this machine.",
      +          "format": "int32",
      +          "type": "integer"
      +        },
      +        "secret_env": {
      +          "additionalProperties": {
      +            "$ref": "#/$defs/SecretID"
      +          },
      +          "description": "Environment variable names mapped to secrets whose values are injected when processes start.",
      +          "type": "object"
      +        },
      +        "source_kind": {
      +          "$ref": "#/$defs/MachineSourceKind",
      +          "description": "Whether the machine is a bring-your-own computer or was created from a machine pool."
      +        },
      +        "updated_at": {
      +          "$ref": "#/$defs/Timestamp",
      +          "description": "When the machine record last changed."
      +        }
      +      },
      +      "required": [
      +        "id",
      +        "org_id",
      +        "source_kind",
      +        "display_name",
      +        "description",
      +        "provider",
      +        "lifecycle_state",
      +        "connection_state",
      +        "last_observed_at",
      +        "cwd",
      +        "env",
      +        "secret_env",
      +        "lifecycle_reason_code",
      +        "lifecycle_reason_message",
      +        "next_reconcile_after",
      +        "provision_attempts",
      +        "delete_attempts",
      +        "metadata",
      +        "deleted_at",
      +        "created_at",
      +        "updated_at"
      +      ],
      +      "type": "object"
      +    },
      +    "MachineConnectionState": {
      +      "enum": [
      +        "online",
      +        "asleep",
      +        "offline"
      +      ],
      +      "type": "string"
      +    },
      +    "MachineFailureReport": {
      +      "description": "The machine's most recent daemon-reported failure. A single slot, overwritten by newer reports. Runtime crash reports remain as historical diagnostics; recovery may clear other failure stages.",
      +      "properties": {
      +        "daemon_version": {
      +          "description": "Daemon version that was running when a daemon update failed.",
      +          "type": "string"
      +        },
      +        "exit_status": {
      +          "description": "Exit status of the failed startup script or daemon install; omitted for other stages.",
      +          "type": "integer"
      +        },
      +        "output_tail": {
      +          "description": "End of the failed step's output, for diagnosis.",
      +          "type": "string"
      +        },
      +        "output_truncated": {
      +          "description": "True when earlier output was dropped or output capture failed.",
      +          "type": "boolean"
      +        },
      +        "reported_at": {
      +          "$ref": "#/$defs/Timestamp",
      +          "description": "When the failure was reported."
      +        },
      +        "stage": {
      +          "description": "Setup or daemon step that failed.",
      +          "enum": [
      +            "startup_script",
      +            "daemon_install",
      +            "daemon_update",
      +            "daemon_runtime",
      +            "daemon_uninstall",
      +            "daemon_uninstalled"
      +          ],
      +          "type": "string"
      +        },
      +        "target_version": {
      +          "description": "Version the daemon was trying to update to when the update failed.",
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "stage",
      +        "output_tail",
      +        "output_truncated",
      +        "reported_at"
      +      ],
      +      "type": "object"
      +    },
      +    "MachineID": {
      +      "description": "Machine ID (mch_...).",
      +      "pattern": "^mch_[a-z2-7]{26}$",
      +      "type": "string"
      +    },
      +    "MachineLifecycleState": {
      +      "enum": [
      +        "provisioning",
      +        "provision_failed",
      +        "active",
      +        "deleting",
      +        "delete_failed",
      +        "deleted"
      +      ],
      +      "type": "string"
      +    },
      +    "MachinePoolID": {
      +      "description": "Machine pool ID (mpo_...).",
      +      "pattern": "^mpo_[a-z2-7]{26}$",
      +      "type": "string"
      +    },
      +    "MachineSourceKind": {
      +      "enum": [
      +        "byo",
      +        "pool"
      +      ],
      +      "type": "string"
      +    },
      +    "Metadata": {
      +      "additionalProperties": {
      +        "maxLength": 512,
      +        "type": "string"
      +      },
      +      "description": "Arbitrary key-value labels stored with the resource.",
      +      "maxProperties": 16,
      +      "propertyNames": {
      +        "maxLength": 64,
      +        "minLength": 1
      +      },
      +      "type": "object"
      +    },
      +    "OrganizationID": {
      +      "pattern": "^org_[a-z2-7]{26}$",
      +      "type": "string"
      +    },
      +    "ProjectID": {
      +      "description": "Project ID (proj_...).",
      +      "pattern": "^proj_[a-z2-7]{26}$",
      +      "type": "string"
      +    },
      +    "ProjectMachineGrant": {
      +      "properties": {
      +        "created_at": {
      +          "$ref": "#/$defs/Timestamp",
      +          "description": "When the grant was created."
      +        },
      +        "description": {
      +          "description": "Free-form note about the grant; empty if none was set.",
      +          "type": "string"
      +        },
      +        "id": {
      +          "$ref": "#/$defs/ProjectMachineGrantID",
      +          "description": "Identifies the machine grant."
      +        },
      +        "machine_id": {
      +          "$ref": "#/$defs/MachineID",
      +          "description": "Machine the project's agents may use."
      +        },
      +        "metadata": {
      +          "$ref": "#/$defs/Metadata",
      +          "description": "Key-value metadata attached to the grant."
      +        },
      +        "org_id": {
      +          "$ref": "#/$defs/OrganizationID",
      +          "description": "Organization that owns the grant."
      +        },
      +        "project_id": {
      +          "$ref": "#/$defs/ProjectID",
      +          "description": "Project the grant gives access to."
      +        },
      +        "project_machine_pool_grant_id": {
      +          "anyOf": [
      +            {
      +              "$ref": "#/$defs/ProjectMachinePoolGrantID"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "description": "Pool grant that created this grant; null for direct grants."
      +        },
      +        "source_kind": {
      +          "$ref": "#/$defs/ProjectMachineGrantSourceKind",
      +          "description": "Whether the grant was made directly or created for a machine from a pool grant."
      +        },
      +        "updated_at": {
      +          "$ref": "#/$defs/Timestamp",
      +          "description": "When the grant last changed."
      +        }
      +      },
      +      "required": [
      +        "id",
      +        "org_id",
      +        "project_id",
      +        "machine_id",
      +        "source_kind",
      +        "description",
      +        "metadata",
      +        "created_at",
      +        "updated_at"
      +      ],
      +      "type": "object"
      +    },
      +    "ProjectMachineGrantID": {
      +      "pattern": "^pmg_[a-z2-7]{26}$",
      +      "type": "string"
      +    },
      +    "ProjectMachineGrantSourceKind": {
      +      "enum": [
      +        "explicit",
      +        "pool"
      +      ],
      +      "type": "string"
      +    },
      +    "ProjectMachinePoolGrantID": {
      +      "pattern": "^pmpg_[a-z2-7]{26}$",
      +      "type": "string"
      +    },
      +    "ResourceName": {
      +      "description": "Human-readable name. Spaces and punctuation are allowed; leading or trailing whitespace and invisible or control characters are not.",
      +      "maxLength": 64,
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "SecretID": {
      +      "description": "Secret ID (sec_...).",
      +      "pattern": "^sec_[a-z2-7]{26}$",
      +      "type": "string"
      +    },
      +    "Timestamp": {
      +      "format": "date-time",
      +      "type": "string"
      +    }
      +  },
      +  "properties": {
      +    "grant": {
      +      "$ref": "#/$defs/ProjectMachineGrant"
      +    },
      +    "machine": {
      +      "$ref": "#/$defs/Machine"
      +    }
      +  },
      +  "required": [
      +    "grant",
      +    "machine"
      +  ],
      +  "type": "object"
      +}
  2. Changed4 schema fields changed
    • addedInput schema / properties / description / description
      Added value: +"Optional note about this grant."
    • addedInput schema / properties / machine_id / description
      Added value: +"Machine ID (mch_...)."
    • addedInput schema / properties / orgID / description
      Added value: +"Organization ID (org_...)."
    • addedInput schema / properties / projectID / description
      Added value: +"Project ID (proj_...)."
  3. Added

TDQS

A3.9/5.0
Behavior3/5

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

Adds real behavior beyond annotations: replay compares request to current grant, and retry-after-revoke can recreate access, including via automatic SDK retries. This is consistent with idempotentHint=false (idempotency is key-scoped, not implicit). However, the idempotency-key mechanics are described without saying where the key comes from, since no such parameter exists in the schema — leaving a notable gap for a mutation tool.

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 core action, then proceeds to constraints and idempotency caveats in a tight sequence. Every sentence carries information, though the closing 'A replay compares the request with the current grant' is somewhat abstract without saying what happens on mismatch.

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?

Annotations and an output schema are present, so the description needn't explain returns; it focuses correctly on the non-obvious semantics (pooled 404, grant-scoped idempotency, revival on retry). Missing only authorization requirements and the source of the idempotency key, which keeps it from a 5.

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

Parameters3/5

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

Schema description coverage is 100%, so orgID, projectID, machine_id, metadata and description are already documented inline; baseline is 3. The description's 'by name' phrasing is slightly at odds with the machine_id (mch_...) pattern parameter and adds no new meaning about any parameter.

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?

States a specific verb and resource ('Lets a project's agent configs use one BYO machine') plus the return value ('returns the grant with the machine's record'). It also distinguishes itself from pooled-machine granting ('Pooled machines can't be granted this way and return 404'), which is enough to separate it from grant_pools_add.

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 a clear when-to-use context (BYO machines only) and an explicit exclusion with observable behavior (pooled machines return 404). It stops short of naming the sibling to use instead or stating prerequisites such as required scopes, so it is clear but not fully routing.

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.