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()

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