Skip to main content
Glama

Create a Policy

create_policy

Create a new policy with target kind, optional target scopes (targetAll/targetLinks/targetQuery), and principal bindings (addPermissions plus at least one principal list; one without the other is an error). Target scopes may be combined; targetAll wins because target="all" applies the policy to every resource. Changing an existing policy: update_policy.

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": {
      "name": "<name>",
      "targetKind": "<targetKind>"
    },
    "name": "create_policy"
  }
}

Input Schema

NameRequiredDescriptionDefault
orgNoOrganization slug.
nameYesResource name. Immutable: renaming is delete and recreate.
tagsNoOptional tags for the policy (behave like Kubernetes labels for selectors and compliance).
addUsersNoUser links to add (e.g., ["//user/alice"])
addGroupsNoGroup links to add
targetAllNoSet to true to target all resources of the kind. Pick the target scope that matches intent (combining scopes is legal; target=all wins).
targetKindYesTarget resource kind (e.g., "secret", "workload", "identity"). Only the kinds listed by get_permissions (needs `?toolsets=full`) have meaningful permission schemas — confirm permission names there before binding.
descriptionNoPolicy description
targetLinksNoTarget resource links (e.g., ["//secret/my-secret"]). GVC-scoped kinds (workload/identity/volumeset/dbcluster) need the gvc segment: //gvc/GVC/workload/NAME. Pick the target scope that matches intent (combining scopes is legal; target=all wins).
targetQueryNoDynamically target resources matching a query (e.g. all secrets tagged env=prod). Pick the target scope that matches intent (combining scopes is legal; target=all wins).
addIdentitiesNoIdentity links to add (e.g., ["//gvc/my-gvc/identity/my-identity"]). Identities are GVC-scoped — the gvc segment is required.
addPermissionsNoPermissions to grant (e.g., ["reveal", "use"]). For the full list run get_permissions (needs `?toolsets=full`). Secret values need `reveal`, not `read`.
addServiceAccountsNoService account links to add (e.g., ["//serviceaccount/sa-1"])

Output Schema

NameRequiredDescriptionDefault
okYes
dataNoThe full result. Read this, not only the summary.
detailsNo
summaryYes
nextStepsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. Changed34 schema fields changed
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedInput schema / additionalProperties
      Removed value: -false
    • removedInput schema / properties / addGroups / maxItems
      Removed value: -200
    • removedInput schema / properties / addIdentities / items / pattern
      Removed value: -"^(\\/\\/gvc\\/[^/]+\\/identity\\/[^/]+|\\/org\\/[^/]+\\/gvc\\/[^/]+\\/identity\\/[^/]+)$"
    • removedInput schema / properties / addIdentities / maxItems
      Removed value: -200
    • removedInput schema / properties / addServiceAccounts / maxItems
      Removed value: -200
    • removedInput schema / properties / addUsers / maxItems
      Removed value: -200
    • removedInput schema / properties / description / maxLength
      Removed value: -250
    • changedInput schema / properties / name / description
      Previous value: -"Resource name (lowercase kebab-case, starts with a letter, 2-64 chars). Names are IMMUTABLE — renaming = delete + recreate (loses URL, DNS, policy links)."New value: +"Resource name. Immutable: renaming is delete and recreate."
    • removedInput schema / properties / name / maxLength
      Removed value: -64
    • removedInput schema / properties / name / minLength
      Removed value: -2
    • removedInput schema / properties / name / pattern
      Removed value: -"^[a-z]([-a-z0-9])*[a-z0-9]$"
    • changedInput schema / properties / org / description
      Previous value: -"Organization slug (lowercase kebab-case). NEVER guess — if the user has not named one, ask. On org-not-found, stop and ask; do not retry variants."New value: +"Organization slug."
    • removedInput schema / properties / org / maxLength
      Removed value: -63
    • removedInput schema / properties / org / minLength
      Removed value: -1
    • removedInput schema / properties / org / pattern
      Removed value: -"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$"
    • removedInput schema / properties / tags / items / additionalProperties
      Removed value: -false
    • removedInput schema / properties / tags / items / properties / key / minLength
      Removed value: -1
    • removedInput schema / properties / tags / maxItems
      Removed value: -50
    • removedInput schema / properties / targetLinks / maxItems
      Removed value: -200
    • removedInput schema / properties / targetQuery / additionalProperties
      Removed value: -false
    • removedInput schema / properties / targetQuery / properties / kind / minLength
      Removed value: -1
    • removedInput schema / properties / targetQuery / properties / spec / additionalProperties
      Removed value: -false
    • removedInput schema / properties / targetQuery / properties / spec / properties / sort / additionalProperties
      Removed value: -false
    • removedInput schema / properties / targetQuery / properties / spec / properties / sort / properties / by / minLength
      Removed value: -1
    • removedInput schema / properties / targetQuery / properties / spec / properties / terms / items / additionalProperties
      Removed value: -false
    • changedInput schema / required
      Previous value: -[
      -  "org",
      -  "name",
      -  "targetKind"
      -]New value: +[
      +  "name",
      +  "targetKind"
      +]
    • removedOutput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedOutput schema / additionalProperties
      Removed value: -false
    • changedOutput schema / properties / data / description
      Previous value: -"The full machine-readable result — list rows, the resource object, query results. Read THIS, not just the summary."New value: +"The full result. Read this, not only the summary."
    • addedOutput schema / properties / details
      Added value: +{
      +  "type": "string"
      +}
    • removedOutput schema / properties / nextSteps / description
      Removed value: -"Recommended follow-up actions for this task, in order."
    • removedOutput schema / properties / ok / description
      Removed value: -"Whether the call succeeded."
    • removedOutput schema / properties / summary / description
      Removed value: -"One-line summary of the result."
  4. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, and openWorldHint=false, so the safety profile is covered. The description adds real behavioral context beyond that: an error condition (permissions without principals), combination semantics for target scopes, and the targetAll precedence rule. It doesn't discuss quota or auth requirements, hence a 4 rather than 5.

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 verb and resource, then the constraints, then the sibling routing. Dense but every sentence carries rule information. The parenthetical parameter list is slightly redundant against the schema but still aids scanning.

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?

With 13 parameters, full schema coverage, an output schema, and mutation annotations, the description supplies the critical invocation rules (mutual requirement, precedence, alternative tool). It stops short of describing response content, but the output schema covers that, so what remains is minor.

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 per-parameter meaning is already fully documented. The description restates the scope-combination and targetAll-wins rules, which the schema also carries on targetAll/targetLinks/targetQuery, adding marginal value and leaving the baseline 3 appropriate for a heavily documented 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?

Specific verb (Create) plus resource (policy) with the key constituent parts named: target kind, target scopes, and principal bindings. It also names the sibling update_policy as the tool for changing an existing policy, so an agent can tell the two apart without opening either schema.

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?

Explicitly states the alternative: 'Changing an existing policy: update_policy.' It also states a hard prerequisite — addPermissions plus at least one principal list, 'one without the other is an error' — which steers invocation rather than leaving the agent to discover the failure.

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.