Skip to content

Fix help and schema descriptions, and let true/false flags send false - #114

Open
zmofei wants to merge 6 commits into
mainfrom
fix/help-descriptions
Open

zmofei wants to merge 6 commits into
mainfrom
fix/help-descriptions

Conversation

@zmofei

@zmofei zmofei commented Oct 23, 2026

Copy link
Copy Markdown
Member

A review of every --help and --schema description turned up text that was cut off, rendered as raw Markdown, wrong, or unusable as written. One commit per kind of change:

  • Trailing optional positionals (static get-image, get-tile, tilesets get-tile) can be left off instead of passed as "". feedback moves to the Maps and data help group.
  • Boolean flags take =false. Before this, a flag could only send true, so attribution, logo, autocomplete, dedupe and continue_straight, which default to true, could never be turned off. The bare flag still sends true, and in a workflow step false still leaves the flag out. directions --snapping-include-* now take one value per coordinate (true;false); the old switch sent a single true, which the API rejects with a 422.
  • --help shows each parameter's whole description, not just its first sentence. A command's or service's own description shows its opening prose as plain text, followed by a Docs: link, instead of the whole Markdown page (geocoder batch was 113 lines). --schema still carries the full text.
  • --schema now fills env and default for arguments that read them in code, and adds a top-level groups list with what each command group's own help says. --id on a non-API command is now a usage error (exit 2) instead of being ignored; before, history show --id x showed the newest run.
  • Wording fixes in hand-written commands and custom-openapi/. docs.tsv now ranks 23 queries first, up from 22. issues.tsv top-3 is 66, one below its recorded 67 and within the slack; the point was lost when usage --help stopped linking the issue tracker.

Compatibility: the --id error and the snapping change are the only behavior changes for an existing command. The snapping switch never produced a working request, and --id used to be silently ignored. The --schema additions don't bump schema_version. All changes are in CHANGELOG.

Verified against the production API: static get-image --attribution=false drops the attribution. --dedupe=false, --autocomplete=false and --continue-straight=false reach the request as false; I didn't check what each one changes in the response. snapping_include_closures=true;true is accepted and a lone true is a 422. A comma-separated matrix sources is a 422. For feedback create, plain base64 screenshot is a 400 and a data URI is accepted; the feature coordinates aren't validated or returned. That test left three "please ignore" feedback items on a test account.

Not verified: the mcp install long help says the hosted server asks the agent to sign in on first use. I haven't tested that.

@zmofei
zmofei marked this pull request as ready for review October 23, 2026 11:29
@zmofei
zmofei requested a review from a team as a code owner October 23, 2026 11:29
mattpodwysocki
mattpodwysocki previously approved these changes Oct 23, 2026

@mattpodwysocki mattpodwysocki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is a really nice cleanup. I checked the true/false flag change against a build from main. --flag and leaving the flag off behave exactly as before, --flag=false and --flag=true used to be usage errors and now work, and --flag false is still rejected, so nothing that worked before changes meaning. Tests, fmt and clippy all pass locally.

Two small things, neither blocking:

  1. In --schema the snapping flags go from a boolean flag to a string option. I agree it's a fix since the old form always got a 422. Just flagging it so we're deliberate about calling it that.
  2. In workflow/runner.rs a step's false still drops the flag, so a workflow can't turn off attribution or logo. The comment's reasoning (an API reading presence rather than value) applies equally to --flag=false on the command line. Maybe a doc note or a follow-up issue?

Looks good to me otherwise.

static get-image/get-tile and tilesets get-tile required every path
positional, so highRes, format and quality had to be passed as "".
The run of omittable positionals at the end is now optional, and the
executor sends an absent one as "". Earlier optional positionals say
in their help how to skip them.

feedback moves from the Search help group to Maps and data, with a
description that says it reads as well as submits.
A boolean query flag could only send true, so a parameter the API
defaults to true (attribution, logo, autocomplete, dedupe,
continue_straight) could never be turned off. It now also takes
--flag=false; the = is required so the optional value can't swallow the
next positional. A workflow step's false still leaves the flag out.

directions --snapping-include-closures and
--snapping-include-static-closures were switches sending a single
true, which the API rejects with a 422. They now take one value per
coordinate, semicolon-separated.
A parameter's help was cut to its first sentence, which dropped the
allowed values and what else it needs ("Requires overview=full"). It now
shows the whole description.

An API command's or service's --help printed the spec's Markdown page
as is: headings, tables, curl examples. It now shows the opening prose,
rendered as plain text, then a Docs: link. --schema still carries the
full description.
…tray --id

--timeout, --output, --no-color, --profile and workflow install
--repo/--ref read their variable or default in code, so --schema only
had them in the description. A [env: X] or [default: X] note in the
help now fills the env and default fields. A new top-level groups list
carries what a command group's own help says, which commands (leaves
only) never included.

--id is global but only API commands read it, so history show --id x
printed the newest run as if it were x. Anywhere else it is now a usage
error.
Hand-written commands: skill --agent/--dir/--ref, mcp list/install,
uninstall (names what stays in ~/.mapbox), config set's keys and
defaults, and usage's long help, which no longer points at the issue
tracker.

custom-openapi: routing profiles, matrix sources/destinations,
directions --waypoints, map-match --approaches, feedback list's
pagination and the places description. The feedback feature and
screenshot notes record what the API accepted on 2026-10-23.

docs.tsv now ranks 23 queries first, up from 22.
…hema shape changed

A step's false still omits a generated boolean flag, so a step cannot
turn off one that defaults to true. The README now says so, and the
runner's comment gives the real reason rather than one that would apply
to --flag=false on the command line too.
@zmofei

zmofei commented Oct 23, 2026

Copy link
Copy Markdown
Member Author

Thanks! Rebased on main. Both addressed in d4154f6: the CHANGELOG snapping entry now calls out the --schema shape change as a fix, and workflow/README.md notes that a step's false leaves the flag out, so a step can't turn off a default-true flag (a script step can, via $MAPBOX_CLI ... --attribution=false). I also corrected the runner comment: the real reason is keeping existing workflows' requests unchanged, not presence-reading APIs. Actually sending false from a step could be a follow-up if anyone needs it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants