CloudBoosterDocs

aws_composition_for

Look up composition rules and peer suggestions for AWS primitives

aws_composition_for

Look up composition rules and peer suggestions for AWS primitives.

Returns the curated composition knowledge — composition rules and suggested peer components — for a set of AWS primitives. Use this to discover what typically deploys alongside a chosen primitive, and to surface the rules the deterministic resolver applies when planning.

  • Family: knowledge
  • Source: cbx-mcp/src/cbx_mcp/tools/knowledge.py::aws_composition_for
  • Backend: POST /v1/knowledge/aws/composition

Input schema

{
  "type": "object",
  "properties": {
    "type_ids": {
      "type": "array",
      "minItems": 1,
      "items": { "type": "string" },
      "description": "AWS primitive type identifiers to resolve composition rules for, e.g. ['aws:s3/bucket@v1']. Must contain at least one entry."
    }
  },
  "required": ["type_ids"]
}

The MCP tool forwards type_ids to the backend's composition endpoint as {"type_ids": [...]}. The list must be non-empty (min_length=1 on the backend).

Output schema

On success the tool returns the backend's PublicKnowledgeResponse wrapped in the standard MCP envelope:

{
  "type": "object",
  "properties": {
    "isError": { "type": "boolean" },
    "result": {
      "type": "object",
      "properties": {
        "kb_version": { "type": "integer" },
        "chunks": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "doc_path":    { "type": "string" },
              "heading":     { "type": ["string", "null"] },
              "chunk_text":  { "type": "string" },
              "chunk_index": { "type": "integer" },
              "token_count": { "type": "integer" },
              "category":    { "type": "string" },
              "type_ids":    { "type": "array", "items": { "type": "string" } },
              "tags":        { "type": "array", "items": { "type": "string" } }
            },
            "required": [
              "doc_path",
              "chunk_text",
              "chunk_index",
              "token_count",
              "category"
            ]
          }
        }
      },
      "required": ["kb_version"]
    },
    "error": { "type": "string" }
  },
  "required": ["isError"]
}

Chunks in this response typically carry category values like composition_rule or peer_suggestion. The type_ids field on each chunk names the primitives the rule applies to, so callers can chain into aws_lookup_primitive or aws_resolve_composition without re-querying.

Example call

{
  "name": "aws_composition_for",
  "arguments": {
    "type_ids": ["aws:s3/bucket@v1", "aws:lambda/function@v1"]
  }
}

Example result

Illustrative — real responses include several chunks covering peer suggestions and applicable rules.

{
  "isError": false,
  "result": {
    "kb_version": 12,
    "chunks": [
      {
        "doc_path": "resources/aws/composition/s3_bucket_public_website.md",
        "heading": "S3 + CloudFront for public websites",
        "chunk_text": "When an S3 bucket is serving a public website, pair it with a CloudFront distribution...",
        "chunk_index": 0,
        "token_count": 168,
        "category": "peer_suggestion",
        "type_ids": [
          "aws:s3/bucket@v1",
          "aws:cloudfront/distribution@v1"
        ],
        "tags": ["public-website", "cdn"]
      }
    ]
  }
}

On this page