Skip to content

docs: document special Dataverse type formats in data command --data (#63) - #169

Open
zekelinAlex wants to merge 1 commit into
TALXIS:masterfrom
zekelinAlex:users/alexander.zekelin/document-data-type-formats-issue-63
Open

zekelinAlex wants to merge 1 commit into
TALXIS:masterfrom
zekelinAlex:users/alexander.zekelin/document-data-type-formats-issue-63

Conversation

@zekelinAlex

Copy link
Copy Markdown
Contributor

Closes #63

The --data option on record create/update and bulk create/update/upsert didn't explain how to format special Dataverse column types, so MCP agents had to discover by trial and error that option sets go as plain integers and lookups as GUID strings. Since the MCP input schemas are generated from the same CliOption attributes, the gap was visible both in CLI help and in the tool descriptions.

This adds the formats to the --data description on all five commands: OptionSet as an integer, Lookup as a GUID string or {Id,LogicalName} object, Money as a decimal, Boolean as true/false, DateTime as an ISO-8601 UTC string.

@TomProkop

Copy link
Copy Markdown
Member

We want to replace this custom JSON with CMT format. the CLI should provide better support for composing the CMT format, which should be consistently used across all commands working with data

Copy link
Copy Markdown
Member

Implementation notes for the agent (TALXIS lab runbook, lane U4)

Owner decision first: Tom commented above that the custom --data JSON should be replaced by the CMT format. This PR changes only help text, with no behaviour change, so the runbook (TALXIS/lab#65, U4) treats it as a stopgap: merge it now, and track the CMT-format change separately. If Tom says close, close it, and skip the rest.

Why the lab needs it: this is lane U4; it ships with G3 but doesn't gate it. Agents creating or fixing records in Dev read these descriptions, both in --help and in the generated MCP tool schemas. Examples: a Product row for #80, test data for CP14. Today they guess the formats for option sets and lookups.

State: 1 commit, 13 behind master. It merges cleanly. master + #179 + #139 + #175 + #169 builds, and all 752 unit tests pass (Oct 24).

Left to do

  1. Rebase onto master.
  2. Correct the text against src/TALXIS.CLI.Platform.Dataverse.Data/EntityJsonConverter.cs:
    • A bare GUID string becomes an EntityReference only for single-target lookups (L150-156). Polymorphic lookups (customer, owner, regarding) need {"Id":"…","LogicalName":"…"}. Say so.
    • Multi-select choice: an array of integers, or a comma-separated string (L134-147, L210-218). Add it.
    • DateTime: any string DateTime.TryParse accepts, stored as UTC. ISO-8601 Z is the right advice.
  3. Deduplicate. The same sentence is pasted five times. Put it in one const string (for example RecordInputHelper.DataFormatHint, which attributes accept) and use it in all five --data options. Mention it on --file too.
  4. Keep the text short. It's repeated in every MCP tool schema, which costs tokens for each tool.

Traps: don't change EntityJsonConverter behaviour in this PR. The CMT-format replacement is the real follow-up; open an issue for it if none exists, and link it here.

Order: independent, any time in U4.

Done when

  • dotnet build TALXIS.CLI.sln -c Release && dotnet test tests/TALXIS.CLI.Tests passes.
  • dotnet run --project src/TALXIS.CLI -- env data record create --help shows the corrected text once. The bulk create, update and upsert commands show the same text.

Generated by Claude Code

Copy link
Copy Markdown
Member

Decision (Tom, Oct 24): merge this as a help-text stopgap (with the corrections in the notes above: polymorphic lookups take {Id, LogicalName}; multi-select choices take an array or a comma-separated string). The CMT format for --data is tracked separately.


Generated by Claude Code

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.

docs: Document special Dataverse type formats in MCP data operation tool descriptions

3 participants