fix(vtex): correct sales-performance metrics param description (all-5-or-none) - #547
Open
guitavano wants to merge 1 commit into
Open
fix(vtex): correct sales-performance metrics param description (all-5-or-none)#547guitavano wants to merge 1 commit into
guitavano wants to merge 1 commit into
Conversation
The `metrics` param claimed the endpoint "expects at least two", but the underlying analytics endpoint only accepts the param fully omitted (all 5 defaults) or all 5 metrics supplied explicitly — partial arrays (1-4 items) return HTTP 422. Split the shared metrics schema so the table tool additionally documents using `sortBy` instead of a partial `metrics` array to rank by one metric; the cards tool keeps the generic constraint. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Fixes the misleading
metricsparameter description on the VTEX Sales Performance analytics tools.The description claimed the endpoint "expects at least two" metrics. In reality the underlying analytics endpoint (
sp-cards/sp-item-detail-table) only accepts themetricsparam fully omitted (returns all 5 defaults) or all 5 supplied explicitly — any partial array of 1–4 items returns HTTP 422. The old wording led agents to send partial arrays and hit 422s.Changes
salesMetricsListSchema.describe(...)(shared byVTEX_GET_SALES_PERFORMANCE_CARDSandVTEX_GET_SALES_PERFORMANCE_TABLE) to document the all-5-or-none constraint and the 422 behavior.salesTableMetricsListSchemathat also tells the agent to omitmetricsand usesortBywhen ranking by a single metric —sortByonly exists on the table tool, so that guidance is scoped to it and kept off the cards tool.Description-only change (plus the schema alias wiring); no runtime behavior change.
Notes / follow-ups
sp-cardsshares the samemetric1..metricNconstraint as the table (same param encoding + backend); if cards tolerates partial arrays, the shared warning can be narrowed.🤖 Generated with Claude Code
Summary by cubic
Clarifies VTEX Sales Performance metrics parameter to reflect the endpoint’s all-5-or-none behavior and prevent 422 errors from partial arrays. Previously documented “at least two” is replaced with: omit
metricsfor defaults or provide all five; partial arrays return 422. Adds table-specific guidance to usesortByfor single-metric ranking. No runtime behavior change.salesMetricsListSchema.describe(...)used byVTEX_GET_SALES_PERFORMANCE_CARDSandVTEX_GET_SALES_PERFORMANCE_TABLE.salesTableMetricsListSchemawithsortByguidance and wired it into the table tool; cards remain on the shared schema.Written for commit ddb0184. Summary will update on new commits.