execute_query
Execute GraphQL queries or mutations with variables on the Bloomy MCP server. Parses and runs operations, returning results or error messages for data interactions with the Bloom Growth platform.
Instructions
Execute a GraphQL query or mutation with variables.
Parses and executes the provided GraphQL operation string with optional variables.
Args:
query: Raw GraphQL query or mutation string
variables: Optional dictionary of variables to use in the operation
Returns:
Dictionary containing the operation results or an error message string
Raises:
Exception: Handled internally, returns error message as string
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| variables | No |
Implementation Reference
- src/bloomy_mcp/operations.py:160-180 (handler)The main handler function for the 'execute_query' tool. It parses the GraphQL query string using gql, executes it against default_client with optional variables, and returns the result or an error message.def execute_query(query: str, variables: Optional[Dict[str, Any]] = None) -> Union[Dict[str, Any], str]: """Execute a GraphQL query or mutation with variables. Parses and executes the provided GraphQL operation string with optional variables. Args: query: Raw GraphQL query or mutation string variables: Optional dictionary of variables to use in the operation Returns: Dictionary containing the operation results or an error message string Raises: Exception: Handled internally, returns error message as string """ try: parsed_query = gql(query) result = default_client.execute(parsed_query, variable_values=variables) return result except Exception as e: return f"Error executing query: {str(e)}"
- src/bloomy_mcp/server.py:39-39 (registration)Registration of the 'execute_query' tool using the FastMCP mcp.tool() decorator.mcp.tool()(execute_query)
- src/bloomy_mcp/server.py:17-17 (registration)Import of the execute_query function in server.py for registration.execute_query,
- src/bloomy_mcp/__init__.py:34-34 (registration)Re-export of execute_query in __init__.py __all__ list."execute_query",