{
  "tools": [
    {
      "name": "nexus_log_entries",
      "title": "Log meals, workouts and weight",
      "description": "Log meals with their calories and macros, finished workouts, and body weight. Use this when the user says what they ate or drank, shares a photo of food, or finishes exercise, e.g. \"I had two eggs and toast\", \"did 3×8 bench at 60 kg\" or \"72.4 kg this morning\". Estimate calories, protein, carbs, fat and fiber carefully from what they share; ask one short question only when an item or portion is too unclear to estimate. Send weights as the user said them, with unit kg or lb. Put everything from the message in one call. If the result is exercise_resolution_required, nothing was saved: follow next_instruction and retry the complete original batch. After a successful log, call nexus_show_interface so the user can check the entry and edit it.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "mutation_id": {
            "type": "string",
            "minLength": 8,
            "maxLength": 128,
            "description": "Generate a unique request id, such as a UUID. Reuse it only while retrying the same user request; use a new id for a separate request."
          },
          "entries": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "workout",
                    "meal",
                    "weight"
                  ],
                  "description": "Choose the kind of record; send the fields for that type."
                },
                "exercise_id": {
                  "description": "Workout: use an existing exercise UUID returned by this server whenever available.",
                  "type": "string"
                },
                "exercise": {
                  "description": "Workout: new exercise name; required only when create_exercise is true.",
                  "type": "string"
                },
                "exercise_key": {
                  "description": "Workout: use a descriptive lowercase_with_underscores key only when no exercise_id is available.",
                  "type": "string"
                },
                "create_exercise": {
                  "description": "Workout: do not set on the first call. Set true only after this server returns exercise options and none matches; this creates a new exercise.",
                  "type": "boolean"
                },
                "sets": {
                  "description": "Workout: one object per completed set.",
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "weight": {
                        "description": "Set load as the number the user gave, in the record's unit; omit for an unweighted set.",
                        "type": "number"
                      },
                      "weight_kg": {
                        "description": "Set load in kilograms, when not sending weight.",
                        "type": "number"
                      },
                      "reps": {
                        "description": "Completed repetitions.",
                        "type": "number"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "duration_min": {
                  "description": "Workout: completed duration in minutes.",
                  "type": "number"
                },
                "distance_km": {
                  "description": "Workout: completed distance in kilometres.",
                  "type": "number"
                },
                "muscle": {
                  "description": "Workout: always choose the closest category so the server returns relevant exercise matches. Use Cardio, Full Body, or Other when no single muscle fits.",
                  "type": "string",
                  "enum": [
                    "Chest",
                    "Back",
                    "Shoulders",
                    "Biceps",
                    "Triceps",
                    "Legs",
                    "Core",
                    "Full Body",
                    "Cardio",
                    "Mobility",
                    "Other"
                  ]
                },
                "pattern": {
                  "description": "Workout: movement family; required only when create_exercise is true.",
                  "type": "string"
                },
                "equipment": {
                  "description": "Workout: equipment; required only when create_exercise is true.",
                  "type": "string"
                },
                "name": {
                  "description": "Meal: name of the food or drink consumed.",
                  "type": "string"
                },
                "calories": {
                  "description": "Meal: estimated total calories; required.",
                  "type": "number"
                },
                "protein_g": {
                  "description": "Meal: estimated protein in grams.",
                  "type": "number"
                },
                "carbs_g": {
                  "description": "Meal: estimated carbohydrates in grams.",
                  "type": "number"
                },
                "fat_g": {
                  "description": "Meal: estimated fat in grams.",
                  "type": "number"
                },
                "fiber_g": {
                  "description": "Meal: estimated dietary fiber in grams.",
                  "type": "number"
                },
                "meal_type": {
                  "description": "Meal: choose the closest meal type.",
                  "type": "string",
                  "enum": [
                    "breakfast",
                    "lunch",
                    "dinner",
                    "snack"
                  ]
                },
                "weight": {
                  "description": "Body weight: the number the user gave, in unit.",
                  "type": "number"
                },
                "weight_kg": {
                  "description": "Body weight in kilograms, when not sending weight.",
                  "type": "number"
                },
                "unit": {
                  "description": "The unit of this record's weight numbers, kg or lb: the unit the user stated, or the weight_unit from an earlier result. Required with weight.",
                  "type": "string",
                  "enum": [
                    "kg",
                    "lb"
                  ]
                },
                "notes": {
                  "description": "Optional context the user wants stored with this record.",
                  "type": "string"
                }
              },
              "required": [
                "type"
              ],
              "additionalProperties": false
            },
            "description": "Send every record from the user's request in one flat array."
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "description": "Use the user's local date as YYYY-MM-DD, not UTC; omitting it can select the wrong day."
          }
        },
        "required": [
          "mutation_id",
          "entries"
        ],
        "additionalProperties": false
      },
      "annotations": {
        "title": "Log meals, workouts and weight",
        "readOnlyHint": false,
        "destructiveHint": false,
        "openWorldHint": false
      },
      "_meta": {
        "ui": {
          "resourceUri": "ui://nexus/sandbox-day.html"
        },
        "openai/outputTemplate": "ui://nexus/sandbox-day.html"
      }
    },
    {
      "name": "nexus_update_entry",
      "title": "Correct a logged entry",
      "description": "Correct one entry the user already logged: a meal, a workout or a body weight. Use this when the user wants to fix something, e.g. \"that was 2 eggs, not 3\". Pass the entry's type, id and state_version from nexus_get_logs_history or nexus_log_entries, plus only the fields that change. A workout's exercise cannot be changed. If state_version is stale, read the entry again and retry with a new mutation_id. To change a planned workout, use nexus_plan_workout_create_or_update.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "mutation_id": {
            "type": "string",
            "minLength": 8,
            "maxLength": 128,
            "description": "Generate a unique request id, such as a UUID. Reuse it only while retrying the same user request; use a new id for a separate request."
          },
          "type": {
            "type": "string",
            "enum": [
              "workout",
              "meal",
              "weight"
            ],
            "description": "Use the record's type returned by this server."
          },
          "id": {
            "type": "string",
            "minLength": 1,
            "description": "Use the record's id returned by this server."
          },
          "state_version": {
            "type": "string",
            "minLength": 1,
            "description": "Use the record's current state_version returned by this server; stale corrections are rejected."
          },
          "sets": {
            "description": "Workout: corrected completed sets; omitted fields stay unchanged.",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "weight": {
                  "description": "Set load as the number the user gave, in the record's unit; omit for an unweighted set.",
                  "type": "number"
                },
                "weight_kg": {
                  "description": "Set load in kilograms, when not sending weight.",
                  "type": "number"
                },
                "reps": {
                  "description": "Completed repetitions.",
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                }
              },
              "additionalProperties": false
            }
          },
          "duration_min": {
            "description": "Workout: corrected duration in minutes; omitted fields stay unchanged.",
            "type": "number",
            "minimum": 0
          },
          "distance_km": {
            "description": "Workout: corrected distance in kilometres; omitted fields stay unchanged.",
            "type": "number",
            "minimum": 0
          },
          "meal_type": {
            "description": "Meal: corrected meal type; omitted fields stay unchanged.",
            "type": "string",
            "enum": [
              "breakfast",
              "lunch",
              "dinner",
              "snack"
            ]
          },
          "items": {
            "description": "Meal: copy the current complete items list returned by this server and correct it; the server recalculates totals. Omitted fields stay unchanged.",
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1
                },
                "quantity": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ]
                },
                "calories": {
                  "type": "number"
                },
                "protein_g": {
                  "type": "number"
                },
                "carbs_g": {
                  "type": "number"
                },
                "fat_g": {
                  "type": "number"
                },
                "fiber_g": {
                  "default": 0,
                  "type": "number"
                }
              },
              "required": [
                "name",
                "quantity",
                "calories",
                "protein_g",
                "carbs_g",
                "fat_g"
              ],
              "additionalProperties": false
            }
          },
          "weight": {
            "description": "Body weight: the corrected number, in unit; omitted fields stay unchanged.",
            "type": "number"
          },
          "weight_kg": {
            "description": "Body weight: corrected kilograms, when not sending weight; omitted fields stay unchanged.",
            "type": "number",
            "exclusiveMinimum": 0
          },
          "unit": {
            "description": "The unit of this record's weight numbers, kg or lb: the unit the user stated, or the weight_unit from an earlier result. Required with weight.",
            "type": "string",
            "enum": [
              "kg",
              "lb"
            ]
          },
          "notes": {
            "description": "Corrected notes; omitted fields stay unchanged.",
            "type": "string"
          }
        },
        "required": [
          "mutation_id",
          "type",
          "id",
          "state_version"
        ]
      },
      "annotations": {
        "title": "Correct a logged entry",
        "readOnlyHint": false,
        "destructiveHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "nexus_get_logs_history",
      "title": "Get history and progress",
      "description": "Read the user's logged meals, workouts, body weight and goals. Use this when an answer depends on what the user actually logged in Nexus: totals, progress, personal records or past workouts, e.g. \"how much protein have I had today?\". Ask for one date or a date range, and filter by type, muscle or friend_id when useful. No entries means nothing was logged, not that the user ate or trained nothing. To show the user a day, use nexus_show_interface.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "description": "One local date as YYYY-MM-DD; use instead of from_date and to_date."
          },
          "from_date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "description": "First local date of the range as YYYY-MM-DD."
          },
          "to_date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "description": "Last local date of the range as YYYY-MM-DD."
          },
          "type": {
            "description": "Return only this kind of record; use workout when filtering by muscle.",
            "type": "string",
            "enum": [
              "workout",
              "meal",
              "weight"
            ]
          },
          "muscle": {
            "description": "With type workout, return only this muscle category.",
            "type": "string",
            "enum": [
              "Chest",
              "Back",
              "Shoulders",
              "Biceps",
              "Triceps",
              "Legs",
              "Core",
              "Full Body",
              "Cardio",
              "Mobility",
              "Other"
            ]
          },
          "friend_id": {
            "description": "Read this friend's shared history using a friend_id returned by this server’s friends tool; omit for the user’s own history.",
            "type": "string"
          }
        }
      },
      "annotations": {
        "title": "Get history and progress",
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "nexus_show_interface",
      "title": "Show the day's summary",
      "description": "Show the user an interactive summary of their day in Nexus: logged meals, workouts and body weight, calorie and macro totals against their goals, and personal records. The user can edit entries right on the card. Call it after every successful nexus_log_entries, and whenever the user asks to see their day. The card shows the details, so keep your reply short; if the result includes a promo, let the card show it and don't repeat it in chat. For data you need to analyze, use nexus_get_logs_history.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "description": "Use the user's local date as YYYY-MM-DD, not UTC; omitting it can select the wrong day."
          }
        }
      },
      "annotations": {
        "title": "Show the day's summary",
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": false
      },
      "_meta": {
        "ui": {
          "resourceUri": "ui://nexus/sandbox-day.html"
        },
        "openai/outputTemplate": "ui://nexus/sandbox-day.html"
      }
    },
    {
      "name": "nexus_update_goals_and_preferences",
      "title": "Set nutrition goals and preferences",
      "description": "Save the user's daily nutrition goals and preferences: calorie, protein, carb, fat and fiber targets, their weight unit (kg or lb) and their timezone. Change targets or the weight unit only when the user asks, e.g. \"set my protein to 150 g\" or \"use pounds\". Set the timezone when the user says where they are, or when it's clear from the conversation. Send only what changes; everything else stays. Include the user's reason for a target change if they give one. Discussing a target is not a request to save it. The timezone is used for reminders only and does not change which day an entry is logged on. Workout, strength and body-weight goals are not supported.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "mutation_id": {
            "type": "string",
            "minLength": 8,
            "maxLength": 128,
            "description": "Generate a unique request id, such as a UUID. Reuse it only while retrying the same user request; use a new id for a separate request."
          },
          "calories": {
            "description": "Daily calorie goal (kcal)",
            "type": "number",
            "minimum": 0
          },
          "protein_g": {
            "description": "Daily protein goal (grams)",
            "type": "number",
            "minimum": 0
          },
          "carbs_g": {
            "description": "Daily carbs goal (grams)",
            "type": "number",
            "minimum": 0
          },
          "fat_g": {
            "description": "Daily fat goal (grams)",
            "type": "number",
            "minimum": 0
          },
          "fiber_g": {
            "description": "Daily dietary fiber goal (grams)",
            "type": "number",
            "minimum": 0
          },
          "reason": {
            "description": "The user's reason for a target change, when they give one.",
            "type": "string"
          },
          "weight_unit": {
            "description": "Show body weight and lifts in kg or lb. Send only when the user asks to switch.",
            "type": "string",
            "enum": [
              "kg",
              "lb"
            ]
          },
          "timezone": {
            "description": "The user's IANA timezone, such as America/New_York. Send when the user says where they are or it is clear from the conversation.",
            "type": "string"
          }
        },
        "required": [
          "mutation_id"
        ]
      },
      "annotations": {
        "title": "Set nutrition goals and preferences",
        "readOnlyHint": false,
        "destructiveHint": false,
        "openWorldHint": false
      }
    }
  ]
}
