Skip to content

subgraph_export

Graph · From docs/MCP_TOOLS.md on GitHub

Category graph · sensitivity restricted · capabilities read_state · readOnly true, destructive false, idempotent true, openWorld false · outputSchema no · timeout: layer default (300 s)

The neighbourhood of a few assets as a self-contained graph document, for visualisation or another tool. Each seed is resolved (the internet alias works), the walk goes depth hops in both directions over edge_types (all when unset), the node set is capped at max_nodes, and a fresh GraphBuilder renders the assets and the edges between kept nodes. format is d3 ({nodes, links}), cytoscape ({elements: {nodes, edges}}) or graphml (an XML string). Returns format, nodes, edges, truncated and graph. For the whole graph read cloudg://graph/{format} instead. The tool is restricted: the GraphML form is one opaque string the privacy transforms cannot look inside, so strict and the soc-analyst analyst do not see it.

Argument Type Default Constraints Description
seeds string[] required min items 1; max items 50 Asset refs to start from.
depth integer 1 0..4 Hops around each seed (0 = only the seeds).
format string "d3" one of d3, cytoscape, graphml Output format of graph.
max_nodes integer 300 1..2000 Node cap for the whole sub-graph.
edge_types string[] or null null Only walk and keep these EdgeType values.
dataset string "" Dataset name (see list_datasets). Empty = the active dataset.

Called with the arguments below, subgraph_export returned this structuredContent.

{"seeds": ["web-1"], "depth": 1, "format": "d3"}
{
  "dataset": "sample",
  "format": "d3",
  "nodes": 6,
  "edges": 5,
  "truncated": false,
  "graph": {
    "nodes": [
      {
        "id": "web-1",
        "name": "web-1",
        "type": "EC2",
        "provider": "AWS",
        "region": "us-east-1",
        "arn": "arn:aws:ec2:us-east-1:111111111111:instance/i-0web1",
        "account_id": "111111111111",
        "is_internet_exposed": false,
        "is_external": false
      },
      {
        "id": "subnet-private",
        "name": "prod-private-a",
        "type": "SUBNET",
        "provider": "AWS",
        "region": "us-east-1",
        "arn": "arn:aws:ec2:us-east-1:111111111111:subnet/subnet-0priv",
        "account_id": "111111111111",
        "is_internet_exposed": false,
        "is_external": false
      },
      "... 3 more"
    ],
    "links": [
      {
        "source": "web-1",
        "target": "sg-app",
        "type": "ATTACHED_TO",
        "port_range": "",
        "protocol": "",
        "cidr": "",
        "direction": "ingress",
        "relationship": "",
        "description": ""
      },
      {
        "source": "web-1",
        "target": "app-role",
        "type": "ASSUMES_ROLE",
        "port_range": "",
        "protocol": "",
        "cidr": "",
        "direction": "ingress",
        "relationship": "",
        "description": ""
      },
      "... 2 more"
    ]
  }
}

Called with the arguments below, subgraph_export returned this structuredContent.

{"seeds": ["bastion"], "depth": 1, "format": "cytoscape", "edge_types": ["ASSUMES_ROLE"]}
{
  "dataset": "sample",
  "format": "cytoscape",
  "nodes": 2,
  "edges": 1,
  "truncated": false,
  "graph": {
    "elements": {
      "nodes": [
        {
          "data": {
            "id": "bastion",
            "label": "bastion",
            "type": "EC2",
            "provider": "AWS",
            "region": "us-east-1",
            "internet_exposed": true
          }
        },
        {
          "data": {
            "id": "admin-role",
            "label": "bastion-admin",
            "type": "IAM_ROLE",
            "provider": "AWS",
            "region": "global",
            "internet_exposed": false
          }
        }
      ],
      "edges": [
        {
          "data": {
            "source": "bastion",
            "target": "admin-role",
            "type": "ASSUMES_ROLE",
            "port_range": "",
            "protocol": ""
          }
        }
      ]
    }
  }
}

Called with the arguments below, subgraph_export returned this structuredContent.

{"seeds": ["web-1"], "depth": 0, "format": "graphml"}
{
  "dataset": "sample",
  "format": "graphml",
  "nodes": 1,
  "edges": 0,
  "truncated": false,
  "graph": "<graphml xmlns=\"http://graphml.graphdrawing.org/xmlns\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/x..."
}

An empty seeds list fails schema validation (min items 1).