Skip to main content
Glama
franccesco

Bloomy MCP

by franccesco

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
NameRequiredDescriptionDefault
mutation_namesYes

Implementation Reference

  • 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")
  • 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)}"
  • 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)
Install Server

Other Tools

Related Tools

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/franccesco/bloomy-mcp'

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