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
| Name | Required | Description | Default |
|---|---|---|---|
| graph_id | Yes | ||
| url_params | Yes |
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)}
- src/graphistry_mcp_server/server.py:629-629 (registration)The @mcp.tool() decorator registers the set_graph_settings function as an MCP tool.@mcp.tool()