get_mutation_details
Retrieve detailed specifications for GraphQL mutations, including argument requirements, return types, descriptions, and usage examples, in YAML format.
Instructions
Get detailed information about specific GraphQL mutations.
Retrieves argument requirements, return type information, descriptions, and
example usage for the specified mutations.
Args:
mutation_names: Comma-separated list of mutation names to get details for
Returns:
A YAML-formatted string containing detailed information about the requested mutations
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mutation_names | Yes |
Implementation Reference
- src/bloomy_mcp/operations.py:145-157 (handler)The handler function that implements the core logic of the 'get_mutation_details' tool by delegating to the shared get_operation_details helper with mutation type.def get_mutation_details(mutation_names: str) -> str: """Get detailed information about specific GraphQL mutations. Retrieves argument requirements, return type information, descriptions, and example usage for the specified mutations. Args: mutation_names: Comma-separated list of mutation names to get details for Returns: A YAML-formatted string containing detailed information about the requested mutations """ return get_operation_details(mutation_names, "mutation")
- src/bloomy_mcp/operations.py:15-127 (helper)Core helper function that performs the GraphQL introspection query to fetch operation details, formats arguments and types, generates examples, and returns YAML output. Used by both get_query_details and get_mutation_details.def get_operation_details(operation_names: str, operation_type: str) -> str: """Get detailed information about specific GraphQL operations. Retrieves and formats detailed information about GraphQL queries or mutations, including arguments, return types, and example usage. Args: operation_names: Comma-separated list of operation names to get details for operation_type: Either "query" or "mutation" Returns: A YAML-formatted string containing detailed information about the requested operations Raises: Exception: If there's an error retrieving the operation details """ type_name = "QueryType" if operation_type == "query" else "MutationType" details_query = gql( f""" {{ __type(name: "{type_name}") {{ fields(includeDeprecated: false) {{ name description args {{ name description type {{ kind name ofType {{ kind name ofType {{ kind name ofType {{ kind name }} }} }} }} defaultValue }} type {{ kind name ofType {{ kind name }} }} }} }} }} """ ) try: result = default_client.execute(details_query) # Parse the list of operation names operation_name_list = [name.strip() for name in operation_names.split(",")] # Collect all requested operations all_details = {} for operation_name in operation_name_list: # Find the specific operation operation_info = None for field in result["__type"]["fields"]: if field["name"] == operation_name: operation_info = field break if not operation_info: all_details[operation_name] = f"{operation_type.capitalize()} '{operation_name}' not found" continue # Format arguments args = [] for arg in operation_info["args"]: type_info = format_type_info(arg["type"]) args.append( { "name": arg["name"], "description": arg["description"] or "No description", "type": type_info, "required": type_info.endswith("!"), "defaultValue": arg["defaultValue"], } ) # Format return type return_type = format_type_info(operation_info["type"]) # Create result structure details = { "name": operation_name, "description": operation_info["description"] or "No description", "arguments": args, "returnType": return_type, "example": generate_operation_example(operation_name, args, operation_type), } all_details[operation_name] = details return yaml.dump(all_details, sort_keys=False) except Exception as e: return f"Error getting {operation_type} details: {str(e)}"
- src/bloomy_mcp/server.py:36-40 (registration)MCP tool registration block where get_mutation_details is registered as a tool using the FastMCP mcp.tool() decorator.# Register tools mcp.tool()(get_query_details) mcp.tool()(get_mutation_details) mcp.tool()(execute_query) mcp.tool()(get_authenticated_user_id)