Skip to main content
Glama
tools.py1.44 kB
""" tools.py This file contains the actual Python functions that the LLM calls whenever it invokes an MCP tool like `setParameter`. These functions delegate the real work to juce_bridge.py, which handles OSC/TCP communication with your JUCE synthesizer. """ from typing import Dict, Any from . import juce_bridge # ------------------------------------------------------------ # Tool function implementations # ------------------------------------------------------------ def setParameter(param: str, value: float) -> Dict[str, Any]: """ Set a JUCE synth parameter. """ juce_bridge.set_parameter(param, value) return {"ok": True, "message": f"Parameter '{param}' set to {value}"} def getParameter(param: str) -> Dict[str, Any]: """ Query a JUCE synth parameter. """ val = juce_bridge.get_parameter(param) return {"value": val} def listParameters() -> Dict[str, Any]: """ List all known parameters. Ultimately you may want this to query JUCE directly. For now it's static or read from config. """ params = juce_bridge.list_parameters() return {"parameters": params} # ------------------------------------------------------------ # Tool registry that mcp_server.py imports # ------------------------------------------------------------ TOOL_FUNCTIONS = { "setParameter": setParameter, "getParameter": getParameter, "listParameters": listParameters, }

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/TYLERSFOSTER/MCPSynthController'

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