Skip to main content
Glama

Second Wind AI

stacks form dependency cycle

cdk-stack-dependency-cycle-fix
Read-onlyIdempotent

Send the CDK cyclic reference error and the resource types of the two construct paths it names. Identifies which edge was added silently by a grant, an origin access control or a bucket notification, explains why, and returns replacement CDK code in TypeScript or Python that keeps the access but removes the back reference. Covers CloudFront OAC with a bucket in another stack, grants into KMS, S3, Secrets Manager, SQS, SNS and ECR policies, and S3 notifications. Use when the error reads: '' depends on '' (...). Adding this dependency (...) would create a cyclic reference | cyclic reference between stacks at cdk synth. Covers: Two stack cycles reported by CDK synth where the error names both construct paths and their resource types are supplied. Three or more stack cycles and nested stack cycles are not covered. Price: 5.00 USDC on Base via x402, charged only when the case is solved.

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": {
      "error_message": "<error_message>",
      "resources": "<resources>"
    },
    "name": "cdk-stack-dependency-cycle-fix"
  }
}

Input Schema

NameRequiredDescriptionDefault
resourcesYesCloudFormation type of each construct path named in the error, keyed by path without the attribute, for example {"DataStack/Bucket/Resource":"AWS::S3::Bucket","WebStack/Distribution/Resource":"AWS::CloudFront::Distribution"}.
cdk_languageNo
error_messageYesThe full CDK error line containing 'would create a cyclic reference'.
uses_customer_kms_keyNoTrue when the bucket, secret, queue or topic in the cycle is encrypted with a customer managed KMS key.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/idempotentHint and non-destructive, so the safety profile is covered; the description adds genuinely new behavior — that it returns compilable replacement code in a chosen language, that it explains why the edge appeared, and the x402 payment terms (5.00 USDC on Base, charged only on a solved case). It does not discuss latency, retries, or auth beyond payment, which keeps it off a 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 action and deliverable, then trigger conditions, then coverage limits, then price — a sensible order. The 'Covers:' sentence partly restates earlier scope language, which is the only real redundancy.

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 no output schema, the description carries the return-value burden and does so (replacement TypeScript or Python code plus a causal explanation), and it discloses pricing and the coverage ceiling. Remaining gaps are minor: the KMS-key flag's effect on the answer is never hinted at.

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 75%, so the schema already documents most parameters; the description still adds that the resources map is keyed by construct path and must cover the two paths named in the error, and that output language is TypeScript or Python. The uses_customer_kms_key parameter is left entirely to the schema, and there is mild tension between 'the two construct paths' and a schema that permits up to 12 properties.

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 action (send the CDK cyclic reference error plus the resource types of the construct paths) and a specific deliverable (identifies the silently added edge, explains why, returns replacement CDK code). The resource families it handles (CloudFront OAC, KMS/S3/Secrets Manager/SQS/SNS/ECR grants, S3 notifications) are named, which separates it from the unrelated sibling tools like cfn-stuck-stack-recovery-plan.

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?

Gives a literal trigger string to match ('would create a cyclic reference') and an explicit boundary: two-stack cycles are covered, while three-or-more-stack cycles and nested stack cycles are not. The when-not is as clear as the when, so an agent can route without inference.

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