Skip to main content
Glama

iam-minimize

IAM policy action minimizer: wildcards to the required action list — Takes an AWS IAM policy JSON and the exact list of actions a task needs (up to 300), and returns the policy with each Allow statement's Action narrowed to just those actions, plus what the original over-grants: wildcards, unused actions, Allow+NotAction, required actions no statement grants, and required actions an unconditional Deny blocks. For an agent that is about to attach or propose a 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": {
      "policy": "<policy>",
      "requiredActions": "<requiredActions>"
    },
    "name": "iam-minimize"
  }
}

Input Schema

NameRequiredDescriptionDefault
policyYesThe IAM policy document as a JSON object or JSON string. At most 60,000 characters.
knownActionsNoOptional catalog of real actions (from the AWS service reference JSON), used to count what each wildcard grants.
requiredActionsYesConcrete actions the task needs, e.g. s3:GetObject. No wildcards.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full disclosure burden and does substantial work: it explains that Allow actions are narrowed, and that wildcards, unused actions, Allow+NotAction, ungranted required actions, and Deny-blocked required actions are all reported back. Gaps remain around whether the input policy is mutated versus a new document returned, and what permissions or failure modes apply to a malformed policy.

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 core sentence is dense but front-loaded, leading with the tool's identity and function before the output detail. The trailing fragment "For an agent that is about to attach or propose a policy" is an incomplete sentence, a minor structural blemish in an otherwise economical definition.

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?

There is no output schema, so the description must convey return content, and it does so by enumerating the narrowed policy plus the specific over-grant categories. Combined with schema-documented size and count limits, an agent has nearly everything needed, with only the return shape of the over-grant report and mutation semantics left implicit.

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 all three parameters are already documented, including the 300-action cap, the 'no wildcards' constraint, and the role of knownActions in counting wildcard grants. The description largely restates those facts rather than adding new syntax, format, or edge-case meaning, so the baseline 3 applies.

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 names a specific verb-and-resource operation: it takes an IAM policy JSON plus a required-action list and returns the policy with each Allow statement's Action narrowed. It also enumerates the over-grant findings produced, so an agent can tell exactly what this tool does and that no sibling in the catalog performs the same IAM narrowing job.

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?

The closing clause, "For an agent that is about to attach or propose a policy," gives a clear situational trigger for use. It does not name an alternative tool or state when not to use it, so it stops short of full when/when-not guidance, but the intended context is unambiguous.

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