Skip to main content
Glama
xunji-private-mcp

xunji-private-mcp

by Vdk1639

upsert_food_records

Destructive

Add new food records or update existing ones after user confirmation; include a record id to change an entry and reuse the request id when retrying uncertain results.

Instructions

Add or update food records after user confirmation. Supply the record id for updates.

Obtain uniquekey, per-100g ntr and any units from official search or the saved custom food. Ask the user to resolve uncertain food matches, meal types, amounts or units. Reuse client_request_id if retrying the same request after an uncertain result.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "foods": "<foods>"
    },
    "name": "upsert_food_records"
  }
}

Input Schema

NameRequiredDescriptionDefault
foodsYes
client_request_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare destructiveHint=true, idempotentHint=false and openWorldHint=true; the description adds genuinely new context on top — that writes require prior user confirmation and that client_request_id should be reused when retrying after an uncertain result, which directly explains how to cope with the non-idempotent behavior. It doesn't spell out what an upsert overwrites on an existing record or what happens to omitted fields.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action and the id-for-update rule, then prerequisites, then disambiguation, then retry semantics — a sensible ordering with no filler sentences. Minor cost from dense abbreviations ('ntr') and a small stray blank-line artifact, but nothing wasteful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

This is a destructive, non-idempotent write against a nested FoodRecord schema with zero field descriptions and no output schema, so the description needs to do a lot. It covers provenance, confirmation and retry well but omits the units/amount/unit interplay, date format expectations, and what a successful response returns for the caller to verify.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries the load, and it does meaningful work: it explains that 'id' selects update-vs-create, that 'ntr' is per-100g nutrition, that uniquekey/units should be sourced from search or custom food, and how client_request_id behaves on retry. It leaves the amount/unit/units relationship and the FoodUnit gram/count structure unexplained.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb pair and resource ('Add or update food records') and clarifies the upsert mechanic directly ('Supply the record id for updates'). It does not explicitly contrast with the sibling upsert_custom_food, so an agent must infer that distinction from the resource name alone.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Strong workflow guidance: it states prerequisites (obtain uniquekey, per-100g ntr and units from official search or the saved custom food), mandates user confirmation, and tells the agent to ask the user about ambiguous matches, meal types, amounts or units. What's missing is an explicit exclusion — nothing says when to prefer upsert_custom_food or query_food_records instead.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.