Normalize tool arguments and accept mapped customFields/issues in YouTrack profile #55
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
create_contentcustomFields mismatch by allowing object-map input and converting it to the array shape expected by YouTrack API.run_commands(execute_command) missingissuesby accepting issue id arrays and mapping primitives to objects matchingCommandListschema.Description
ParameterDefinition.typecan be aParameterType[]) and emitoneOfJSON Schema inToolGeneratorand generated Zod schemas.object_entries_to_arrayandarray_item_to_objectinsrc/types/profile.tsandprofile-schema.jsonto describe object→array and array-item→object transformations.src/argument-normalizer.tswithnormalizeArguments()and integrate it intoexecuteSimpleToolinsrc/mcp-server.tsto perform the conversions at runtime.profiles/youtrack/profile.jsonandprofile.test.json) and tests to acceptcustomFieldsas object maps andissuesarrays, and addsrc/argument-normalizer.test.tsplus a multi-type schema test insrc/tool-generator.test.ts.Testing
npm run generate-schemaswhich completed successfully.npm run test:unit -- -t "normalizeArguments|Profile Test: youtrack-optimized"and the focused tests passed.npm run coverage -- --coverage.include=src/argument-normalizer.tswhich completed successfully and all unit tests passed.92.75%andsrc/argument-normalizer.tsfile coverage reported92.75%(with uncovered lines shown in the coverage output).Codex Task