Class GooseRecipeParser

java.lang.Object
com.tnsai.mcp.goose.GooseRecipeParser

public class GooseRecipeParser extends Object
Parses Goose recipe files (JSON workflow definitions).

Goose recipes define sequences of tool calls that form a workflow. This parser reads JSON recipe files and converts them to structured GooseRecipeParser.Recipe objects that can be further converted to MCP tool calls.

Expected JSON format:


 {
   "name": "deploy-app",
   "description": "Deploy an application",
   "steps": [
     {
       "tool": "build_project",
       "params": { "target": "production" },
       "output": "buildResult"
     },
     {
       "tool": "deploy",
       "params": { "artifact": "{{buildResult}}" }
     }
   ]
 }
 
See Also:
  • Method Details

    • parse

      public static GooseRecipeParser.Recipe parse(String content) throws IOException
      Parses a recipe from a JSON string.
      Parameters:
      content - the JSON content to parse
      Returns:
      the parsed recipe
      Throws:
      IOException - if parsing fails
    • toMcpCalls

      public static List<Map<String,Object>> toMcpCalls(GooseRecipeParser.Recipe recipe)
      Converts recipe steps to a list of MCP tool call parameter maps.

      Each map in the result contains:

      • name - the tool name
      • arguments - the tool arguments
      Parameters:
      recipe - the recipe to convert
      Returns:
      list of MCP tool call parameter maps