Skip to main content
Glama

set_graph_settings

Adjust graph visualization parameters like point size and edge influence to customize how network data appears in Graphistry MCP visualizations.

Instructions

Set visualization settings for a graph using Graphistry's settings API.

Args:
    graph_id (str): The ID of the graph to modify.
    url_params (dict): Dictionary of Graphistry URL parameters to control visualization. Example: {'pointSize': 0.5, 'edgeInfluence': 2, 'play': 0}.

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

Example:
    set_graph_settings(graph_id, url_params={'pointSize': 0.5, 'play': 0})

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
graph_idYes
url_paramsYes

Implementation Reference

  • The handler function for 'set_graph_settings' tool. It applies custom URL parameters to the graph visualization settings using Graphistry's settings method and returns the updated graph URL. The @mcp.tool() decorator registers it as an MCP tool.
    @mcp.tool()
    async def set_graph_settings(graph_id: str, url_params: dict) -> Dict[str, Any]:
        """
        Set visualization settings for a graph using Graphistry's settings API.
    
        Args:
            graph_id (str): The ID of the graph to modify.
            url_params (dict): Dictionary of Graphistry URL parameters to control visualization. Example: {'pointSize': 0.5, 'edgeInfluence': 2, 'play': 0}.
    
        Returns:
            dict: { 'graph_id': ..., 'url': ... } with the updated visualization URL.
    
        Example:
            set_graph_settings(graph_id, url_params={'pointSize': 0.5, 'play': 0})
        """
        if graph_id not in graph_cache:
            raise ValueError(f"Graph not found: {graph_id}")
        g = graph_cache[graph_id]["graph"]
        g = g.settings(url_params=url_params)
        graph_cache[graph_id]["graph"] = g
        return {"graph_id": graph_id, "url": g.plot(render=False)}
  • The @mcp.tool() decorator registers the set_graph_settings function as an MCP tool.
    @mcp.tool()
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states this is a mutation tool ('Set', 'modify'), implying it changes graph settings, but doesn't disclose behavioral traits like required permissions, whether changes are persistent or reversible, rate limits, or error handling. The description adds minimal context beyond the basic action, leaving significant gaps in understanding the tool's behavior.

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 appropriately sized and front-loaded, starting with a clear purpose statement. It follows with structured sections for Args, Returns, and Example, each adding value without redundancy. Every sentence serves a purpose, making it efficient and easy to scan.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (2 parameters with nested objects, no annotations, no output schema), the description is moderately complete. It covers the purpose, parameters, and return format adequately, but lacks behavioral context and usage guidelines. For a mutation tool without annotations, it should do more to explain side effects, permissions, or error cases to be fully comprehensive.

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?

The description adds substantial meaning beyond the input schema, which has 0% description coverage. It explains that 'graph_id' identifies the graph to modify and 'url_params' is a dictionary of Graphistry URL parameters for visualization control, providing an example with specific keys like 'pointSize'. This compensates well for the schema's lack of documentation, though it doesn't detail all possible parameters or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Set visualization settings') and target resource ('for a graph using Graphistry's settings API'), which is specific and unambiguous. However, it doesn't explicitly differentiate this tool from its sibling tools like 'visualize_graph' or 'apply_layout', which might also involve graph visualization aspects, leaving some room for confusion about when to choose this specific tool.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With multiple sibling tools related to graph visualization and layout (e.g., 'visualize_graph', 'apply_layout', 'apply_group_in_a_box_layout'), there is no mention of prerequisites, specific use cases, or exclusions. The example shows usage but doesn't explain context or trade-offs.

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