{
  "name": "Meshpit",
  "version": "1.0.0",
  "description": "Parametric 3D model editor powered by OpenSCAD. Write or generate OpenSCAD code, preview in a live 3D viewer, adjust parameters interactively, and download STL files for 3D printing.",
  "url": "https://meshpit.app/playground",
  "tools": [
    {
      "name": "get_current_code",
      "description": "Returns the full OpenSCAD source code currently loaded in the editor.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "set_code",
      "description": "Replaces the entire OpenSCAD source code in the editor. The model recompiles automatically after the change.",
      "input": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "The complete OpenSCAD source code to load into the editor"
          }
        },
        "required": ["code"]
      }
    },
    {
      "name": "get_parameters",
      "description": "Returns all parameter definitions and their current values. Parameters are declared in the OpenSCAD source using special comment syntax.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "set_parameter",
      "description": "Sets a named parameter to a new value. The model recompiles automatically.",
      "input": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The parameter name (case-sensitive)"
          },
          "value": {
            "oneOf": [
              { "type": "string" },
              { "type": "number" },
              { "type": "boolean" }
            ],
            "description": "The new value for the parameter"
          }
        },
        "required": ["name", "value"]
      }
    },
    {
      "name": "get_viewer_state",
      "description": "Returns the current state of all 3D viewer toggles: grid, axis helper, wireframe opacity, orthographic/perspective camera, SSAO, bloom, soft shadows, presentation mode, measurement mode, multi-view, and background color.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "get_model_info",
      "description": "Returns metadata about the currently open model: title, visibility (public/private), unsaved changes status, and last-saved timestamp.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "action_save",
      "description": "Saves the current model. If unsaved for the first time, opens the save dialog to set title and visibility.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "action_fork_model",
      "description": "Forks the current model into a new copy in the user's account.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "action_share",
      "description": "Opens the share dialog to copy a shareable URL or embed code for the current model.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "action_screenshot",
      "description": "Opens the screenshot dialog to capture the current 3D canvas as a PNG image.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "action_ai_assistant",
      "description": "Opens the AI Assistant dialog to generate or modify OpenSCAD code using a large language model.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "action_version_history",
      "description": "Opens the version history panel to browse, preview, and restore past saved versions of the model.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "params_randomize",
      "description": "Randomizes all parameter values within their declared valid ranges, triggering a recompile.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "params_reset",
      "description": "Resets all parameters to their default values as declared in the OpenSCAD source.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "params_download_stl",
      "description": "Downloads the current compiled mesh as an STL file at draft quality.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "params_download_scad",
      "description": "Downloads the current OpenSCAD source code as a .scad file.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "viewer_grid",
      "description": "Toggles the ground-plane grid in the 3D viewer.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "viewer_axis",
      "description": "Toggles the XYZ axis helper gizmo in the 3D viewer.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "viewer_orthographic",
      "description": "Toggles between orthographic and perspective camera projection in the 3D viewer.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "viewer_wireframe",
      "description": "Toggles wireframe overlay on the 3D mesh.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "viewer_multiview",
      "description": "Toggles multi-view mode (splits the canvas into top, front, right, and perspective views).",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "viewer_ssao",
      "description": "Toggles Screen Space Ambient Occlusion (SSAO) post-processing for contact shadows.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "viewer_bloom",
      "description": "Toggles bloom/glow post-processing effect in the 3D viewer.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "viewer_soft_shadows",
      "description": "Toggles percentage-closer soft shadows (PCSS) in the 3D viewer.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "viewer_presentation",
      "description": "Toggles presentation/auto-rotate mode — the model slowly rotates for display.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "viewer_measurement",
      "description": "Toggles measurement mode — click on mesh points to measure distances.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "viewer_fit_to_bounds",
      "description": "Zooms and pans the camera to fit the entire model within the viewport.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "insert_cube",
      "description": "Inserts an OpenSCAD cube() primitive at the editor cursor position.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "insert_sphere",
      "description": "Inserts an OpenSCAD sphere() primitive at the editor cursor position.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "insert_cylinder",
      "description": "Inserts an OpenSCAD cylinder() primitive at the editor cursor position.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "insert_translate",
      "description": "Inserts a translate() transform wrapper at the editor cursor position.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "insert_rotate",
      "description": "Inserts a rotate() transform wrapper at the editor cursor position.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "insert_union",
      "description": "Inserts a union() boolean operation block at the editor cursor position.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "insert_difference",
      "description": "Inserts a difference() boolean operation block at the editor cursor position.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "insert_linear_extrude",
      "description": "Inserts a linear_extrude() wrapper at the editor cursor position.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "insert_module",
      "description": "Inserts an OpenSCAD module definition snippet at the editor cursor position.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "insert_parameter_block",
      "description": "Inserts a parameter block comment snippet (/* [Parameters] */) for declaring interactive parameters.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "nav_new",
      "description": "Navigates to a blank new model editor.",
      "input": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "nav_explore",
      "description": "Navigates to the Explore page to browse public models.",
      "input": { "type": "object", "properties": {}, "required": [] }
    }
  ],
  "flows": [
    {
      "name": "Create a parametric 3D model from a description",
      "description": "Use the AI assistant to generate OpenSCAD code from a natural language description, then adjust parameters interactively and download the STL.",
      "steps": [
        "Call action_ai_assistant to open the AI dialog",
        "The user provides a description; the AI generates OpenSCAD code",
        "Call get_parameters to inspect the generated parameters",
        "Call set_parameter to adjust individual parameter values",
        "Call params_download_stl to download the final mesh"
      ]
    },
    {
      "name": "Edit an existing model programmatically",
      "description": "Read the current code, modify it, and push it back to the editor.",
      "steps": [
        "Call get_current_code to read the OpenSCAD source",
        "Modify the code as needed",
        "Call set_code with the updated source",
        "Call get_parameters to verify parameters parsed correctly"
      ]
    },
    {
      "name": "Tune parameters for a specific output",
      "description": "Inspect and adjust all parameters until the model meets requirements, then export.",
      "steps": [
        "Call get_parameters to list all parameters and their current values",
        "Call set_parameter for each parameter to adjust",
        "Repeat until satisfied",
        "Call params_download_stl to export the STL"
      ]
    }
  ]
}
