Skip to main content
Glama

set_graph_settings

Customize and update graph visualization settings using Graphistry's API. Specify parameters like pointSize and edgeInfluence to modify interactive graph displays. Returns the updated graph URL for instant preview.

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 the 'set_graph_settings' MCP tool. It is decorated with @mcp.tool() which also serves as registration. The function retrieves the graph object from cache, applies the provided url_params using Graphistry's settings method, updates the cache, and returns the updated graph ID and URL.
    @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