Graph validate

graph-validate · version 1.0.0 · Graphs & scheduling · free, no key needed

Inspect a well-formed directed simple graph and report counts, isolated nodes, and maximum degrees.

Use when you need to: graph validate · inspect directed graph structure · count isolated nodes and degrees.

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "nodes": [
    "a",
    "b",
    "c",
    "d"
  ],
  "edges": [
    {
      "from": "a",
      "to": "b"
    },
    {
      "from": "a",
      "to": "c"
    },
    {
      "from": "c",
      "to": "c"
    }
  ]
}

Response:

{
  "result": {
    "node_count": 4,
    "edge_count": 3,
    "self_loop_count": 1,
    "isolated_node_count": 1,
    "max_in_degree": 2,
    "max_out_degree": 2
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "graph-validate",
  "version": "1.0.0",
  "input": {
    "nodes": [
      "a",
      "b",
      "c",
      "d"
    ],
    "edges": [
      {
        "from": "a",
        "to": "b"
      },
      {
        "from": "a",
        "to": "c"
      },
      {
        "from": "c",
        "to": "c"
      }
    ]
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/graph-validate/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"nodes":["a","b","c","d"],"edges":[{"from":"a","to":"b"},{"from":"a","to":"c"},{"from":"c","to":"c"}]}'

The machine-readable contract is at /v1/tools/graph-validate/versions/1.0.0.

CLI

node cli.mjs run graph-validate 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.