Skip to main content
Glama

apply_ring_categorical_layout

Organize graph nodes into concentric rings based on categorical attributes to visualize relationships by group membership.

Instructions

Apply a categorical ring layout to the graph using Graphistry's ring_categorical_layout API.

Args:
    graph_id (str): The ID of the graph to modify.
    ring_col (str): The node column to use for determining ring membership (e.g., a categorical attribute like 'type' or 'group').

Returns:
    dict: { 'graph_id': ..., 'url': ... } with the updated visualization URL.

Example:
    apply_ring_categorical_layout(graph_id, ring_col='type')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
graph_idYes
ring_colYes

Implementation Reference

  • The handler function for the 'apply_ring_categorical_layout' tool. It is registered via the @mcp.tool() decorator and implements the core logic by calling Graphistry's ring_categorical_layout method on the cached graph object.
    @mcp.tool()
    async def apply_ring_categorical_layout(graph_id: str, ring_col: str) -> Dict[str, Any]:
        """
        Apply a categorical ring layout to the graph using Graphistry's ring_categorical_layout API.
    
        Args:
            graph_id (str): The ID of the graph to modify.
            ring_col (str): The node column to use for determining ring membership (e.g., a categorical attribute like 'type' or 'group').
    
        Returns:
            dict: { 'graph_id': ..., 'url': ... } with the updated visualization URL.
    
        Example:
            apply_ring_categorical_layout(graph_id, ring_col='type')
        """
        if graph_id not in graph_cache:
            raise ValueError(f"Graph not found: {graph_id}")
        g = graph_cache[graph_id]["graph"]
        g = g.ring_categorical_layout(ring_col)
        graph_cache[graph_id]["graph"] = g
        return {"graph_id": graph_id, "url": g.plot(render=False)}
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses that this modifies a graph (implied mutation) and returns a visualization URL, but lacks details on permissions, rate limits, side effects, or what 'modify' entails (e.g., whether it overwrites existing layouts). The example adds some context but behavioral traits are incomplete.

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 well-structured and front-loaded with the core purpose. Each section (Args, Returns, Example) earns its place by providing essential information without redundancy. The example is concise and illustrative.

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?

Given 2 parameters with 0% schema coverage and no output schema, the description does a good job explaining inputs and the return structure. However, as a mutation tool with no annotations, it could better address behavioral aspects like idempotency or error conditions. The example helps but doesn't fully compensate for missing output schema details.

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 description coverage is 0%, so the description must compensate. It explains both parameters: graph_id identifies the target graph, and ring_col specifies the categorical attribute for ring membership, with an example ('type' or 'group'). This adds meaningful semantics beyond the bare schema, though it doesn't detail format constraints or edge cases.

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 states the specific action ('Apply a categorical ring layout') and resource ('to the graph'), using the exact API name. It distinguishes from siblings like 'apply_ring_continuous_layout' and 'apply_time_ring_layout' by specifying 'categorical' layout type.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage through the example showing ring_col='type', suggesting it's for categorical attributes. However, it doesn't explicitly state when to use this vs alternatives like 'apply_ring_continuous_layout' or 'apply_group_in_a_box_layout', nor does it mention prerequisites or exclusions.

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/graphistry/graphistry-mcp'

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