Skip to main content
Glama

graph_operation

Create a graph from named examples or adjacency lists, then compute key properties like chromatic number, connectivity, diameter, planarity, and shortest paths.

Instructions

Graph theory: create named graphs and compute properties (chromatic_number, is_connected, diameter, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
graphYesGraph constructor: a named graph like 'PetersenGraph' or an adjacency dict like '{0:[1,2], 1:[0,2], 2:[0,1]}'
sourceNoSource vertex
targetNoTarget vertex
sessionNoNamed workspace to use. Workspaces have independent variables; omit for 'default'.default
operationYesOne of: chromatic_number, is_connected, is_planar, diameter, order, size, degree_sequence, adjacency_matrix, shortest_path (requires source and target)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior2/5

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

With no annotations, the description must disclose behavioral traits. It hints at side effects by mentioning 'create named graphs' but does not explain whether operations modify the workspace, what happens on invalid graphs, or any permissions. This lack of transparency is a clear gap for a tool that may mutate session state.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single front-loaded sentence that pairs a domain label with action verbs and concrete examples, with no filler. Every word contributes to understanding the tool's purpose.

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?

The combination of a rich schema, output schema, and the domain-specific description is sufficient for an agent to understand the tool's scope. However, the description alone is thin regarding operation-specific requirements (e.g., source/target for shortest_path), which are only in the schema, so it is not fully self-contained.

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?

The input schema already describes all five parameters at 100% coverage, including valid operations and graph constructor formats. The description merely echoes some operation names without adding new semantic information, so it stays at the baseline of 3 for high schema coverage.

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 clearly identifies the domain (Graph theory) and the specific actions: 'create named graphs and compute properties'. It lists concrete property examples (chromatic_number, is_connected, diameter) and uses 'etc.' to indicate more, making it distinct from sibling operation tools like geometry_operation or group_operation.

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 'Graph theory:' prefix provides clear context for when to select this tool among the sibling math operation tools. However, it does not explicitly state when not to use it or mention alternatives, so it lacks explicit exclusion guidance but offers clear domain context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/XBP-Europe/sagemath-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server