@yoryoboy/bi-mcp 1.7.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/index.js +27 -5
  3. package/dist/index.js.map +2 -2
  4. package/dist/mcp-use.json +6 -3
  5. package/dist/src/services/mercadolibre/mercadolibre-billing.js +77 -0
  6. package/dist/src/services/mercadolibre/mercadolibre-billing.js.map +7 -0
  7. package/dist/src/services/mercadolibre/mercadolibre-items.js +29 -2
  8. package/dist/src/services/mercadolibre/mercadolibre-items.js.map +2 -2
  9. package/dist/src/services/mercadolibre/mercadolibre-orders.js +18 -0
  10. package/dist/src/services/mercadolibre/mercadolibre-orders.js.map +2 -2
  11. package/dist/src/tools/mercadolibre/estimate-listing-fee.js +26 -34
  12. package/dist/src/tools/mercadolibre/estimate-listing-fee.js.map +2 -2
  13. package/dist/src/tools/mercadolibre/estimate-product-profitability.js +546 -0
  14. package/dist/src/tools/mercadolibre/estimate-product-profitability.js.map +7 -0
  15. package/dist/src/tools/mercadolibre/get-item-details.js +3 -25
  16. package/dist/src/tools/mercadolibre/get-item-details.js.map +2 -2
  17. package/dist/src/tools/mercadolibre/get-sales-by-item.js +129 -14
  18. package/dist/src/tools/mercadolibre/get-sales-by-item.js.map +2 -2
  19. package/dist/src/tools/mercadolibre/get-sales-trend.js +137 -14
  20. package/dist/src/tools/mercadolibre/get-sales-trend.js.map +2 -2
  21. package/dist/src/tools/mercadolibre/get-shipping-summary.js +450 -57
  22. package/dist/src/tools/mercadolibre/get-shipping-summary.js.map +2 -2
  23. package/dist/src/tools/mercadolibre/get-site-categories-and-listing-types.js +50 -0
  24. package/dist/src/tools/mercadolibre/get-site-categories-and-listing-types.js.map +7 -0
  25. package/dist/src/tools/mercadolibre/index.js +2 -0
  26. package/dist/src/tools/mercadolibre/index.js.map +2 -2
  27. package/dist/src/tools/mercadolibre/listing-fee-helpers.js +265 -0
  28. package/dist/src/tools/mercadolibre/listing-fee-helpers.js.map +7 -0
  29. package/dist/src/tools/mercadolibre/search-items.js +207 -52
  30. package/dist/src/tools/mercadolibre/search-items.js.map +2 -2
  31. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -167,10 +167,14 @@ import {
167
167
  meliCreateItemSchema,
168
168
  meliEstimateListingFeeHandler,
169
169
  meliEstimateListingFeeSchema,
170
+ meliEstimateProductProfitabilityHandler,
171
+ meliEstimateProductProfitabilitySchema,
170
172
  meliGetAccountContextHandler,
171
173
  meliGetAccountContextSchema,
172
174
  meliGetCategoryRequirementsHandler,
173
175
  meliGetCategoryRequirementsSchema,
176
+ meliGetSiteCategoriesAndListingTypesHandler,
177
+ meliGetSiteCategoriesAndListingTypesSchema,
174
178
  meliGetItemDetailsHandler,
175
179
  meliGetItemDetailsSchema,
176
180
  meliGetItemVisitsHandler,
@@ -1261,7 +1265,7 @@ server.tool(
1261
1265
  server.tool(
1262
1266
  {
1263
1267
  name: "meli_get_sales_by_item",
1264
- description: "Aggregate MercadoLibre sales by item and variation for a date range, split by currency.",
1268
+ description: "Aggregate MercadoLibre sales by item and variation for a date range, split by currency. Returns sales_by_item_schema plus compact positional rows to minimize tokens. The tool fan-outs internally across all order-search pages for the range when possible and returns metadata that makes partial coverage explicit if some pages fail.",
1265
1269
  schema: meliGetSalesByItemSchema,
1266
1270
  annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true }
1267
1271
  },
@@ -1279,7 +1283,7 @@ server.tool(
1279
1283
  server.tool(
1280
1284
  {
1281
1285
  name: "meli_get_shipping_summary",
1282
- description: "Summarize MercadoLibre shipment statuses, substatuses, and shipping costs from recent orders.",
1286
+ description: "Build a MercadoLibre shipping report for a date range. Default responseMode=calculations returns aggregate delivery health, logistics mix, cost, and daily trend KPIs; responseMode=shipments_chunk returns compact shipment rows with continuation metadata.",
1283
1287
  schema: meliGetShippingSummarySchema,
1284
1288
  annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true }
1285
1289
  },
@@ -1306,7 +1310,7 @@ server.tool(
1306
1310
  server.tool(
1307
1311
  {
1308
1312
  name: "meli_search_items",
1309
- description: "Search MercadoLibre items for the selected seller with optional compact multiget details.",
1313
+ description: "Search MercadoLibre seller items with compact detailed rows. Defaults to status=active, supports title text search, and returns items_schema plus compact item rows instead of raw item ids.",
1310
1314
  schema: meliSearchItemsSchema,
1311
1315
  annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true }
1312
1316
  },
@@ -1315,7 +1319,7 @@ server.tool(
1315
1319
  server.tool(
1316
1320
  {
1317
1321
  name: "meli_get_item_details",
1318
- description: "Get MercadoLibre item details for one or more item ids with multiget and fallback batch handling.",
1322
+ description: "Get rich MercadoLibre item details for one or more item ids with multiget and fallback batch handling. Returns near-raw listing context including attributes, sale terms, shipping, seller/location, dates, tags, and status, excluding pictures.",
1319
1323
  schema: meliGetItemDetailsSchema,
1320
1324
  annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true }
1321
1325
  },
@@ -1348,15 +1352,33 @@ server.tool(
1348
1352
  },
1349
1353
  meliGetCategoryRequirementsHandler
1350
1354
  );
1355
+ server.tool(
1356
+ {
1357
+ name: "meli_get_site_categories_and_listing_types",
1358
+ description: "Get MercadoLibre Argentina site categories and available listing types in a single catalog response.",
1359
+ schema: meliGetSiteCategoriesAndListingTypesSchema,
1360
+ annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true }
1361
+ },
1362
+ meliGetSiteCategoriesAndListingTypesHandler
1363
+ );
1351
1364
  server.tool(
1352
1365
  {
1353
1366
  name: "meli_estimate_listing_fee",
1354
- description: "Estimate MercadoLibre selling fees and price breakdowns for a proposed listing.",
1367
+ description: "Estimate MercadoLibre selling fees with guided precision. Accepts an itemId to autocomplete listing parameters or manual price/category/listing/logistics/weight inputs, and returns missing params when precision can improve.",
1355
1368
  schema: meliEstimateListingFeeSchema,
1356
1369
  annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true }
1357
1370
  },
1358
1371
  meliEstimateListingFeeHandler
1359
1372
  );
1373
+ server.tool(
1374
+ {
1375
+ name: "meli_estimate_product_profitability",
1376
+ description: "Estimate whether a MercadoLibre product is profitable, using precise fee quotes, historical order/shipping data, and optional Billing ML audit. If user costs are missing, returns break-even limits and guided questions instead of failing.",
1377
+ schema: meliEstimateProductProfitabilitySchema,
1378
+ annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true }
1379
+ },
1380
+ meliEstimateProductProfitabilityHandler
1381
+ );
1360
1382
  server.tool(
1361
1383
  {
1362
1384
  name: "meli_create_item",
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../index.ts"],
4
- "sourcesContent": ["import { createRequire } from \"node:module\";\nimport { pathToFileURL } from \"node:url\";\nimport { MCPServer } from \"mcp-use/server\";\n\nimport {\n reporteVentasPromptHandler,\n reporteVentasPromptSchema,\n} from \"./src/prompts/reporte-ventas.js\";\nimport { getBenchmarksHandler, getBenchmarksSchema } from \"./src/config/benchmarks.js\";\nimport {\n checkDatabaseConnectionHandler,\n checkDatabaseConnectionSchema,\n listProfilesHandler,\n listProfilesSchema,\n googleAdsAccountRisksHandler,\n googleAdsAccountRisksSchema,\n googleAdsAccountOverviewHandler,\n googleAdsAccountOverviewSchema,\n googleAdsBreakEvenAnalysisHandler,\n googleAdsBreakEvenAnalysisSchema,\n googleAdsCampaignPerformanceHandler,\n googleAdsCampaignPerformanceSchema,\n googleAdsChannelMixHandler,\n googleAdsChannelMixSchema,\n googleAdsCompareAccountsHandler,\n googleAdsCompareAccountsSchema,\n googleAdsCustomerClientsHandler,\n googleAdsCustomerClientsSchema,\n googleAdsCustomerInfoHandler,\n googleAdsCustomerInfoSchema,\n googleAdsSearchTermsSummaryHandler,\n googleAdsSearchTermsSummarySchema,\n googleAdsScalingHealthHandler,\n googleAdsScalingHealthSchema,\n googleAdsTimeSeriesHandler,\n googleAdsTimeSeriesSchema,\n listAccessibleSitesHandler,\n listAccessibleSitesSchema,\n attributionGapsHandler,\n attributionGapsSchema,\n activateSkuHandler,\n activateSkuSchema,\n addOrderTrackingHandler,\n addOrderTrackingSchema,\n associateSpecificationHandler,\n associateSpecificationSchema,\n attachCatalogImageHandler,\n attachCatalogImageSchema,\n cancelOrderHandler,\n cancelOrderSchema,\n channelMixHandler,\n channelMixSchema,\n computedPriceHandler,\n computedPriceSchema,\n createBrandHandler,\n createBrandSchema,\n createCategoryHandler,\n createCategorySchema,\n createProductHandler,\n createProductSchema,\n createProductWithSkuHandler,\n createProductWithSkuSchema,\n createSkuHandler,\n createSkuSchema,\n createSpecificationHandler,\n createSpecificationSchema,\n createSpecificationValueHandler,\n createSpecificationValueSchema,\n deactivateSkuHandler,\n deactivateSkuSchema,\n deleteFixedPriceHandler,\n deleteFixedPriceSchema,\n ecommerceTrackingHealthHandler,\n ecommerceTrackingHealthSchema,\n engagementOverviewHandler,\n engagementOverviewSchema,\n invoiceOrderHandler,\n invoiceOrderSchema,\n inventoryCheckHandler,\n inventoryCheckSchema,\n listAccessiblePropertiesHandler,\n listAccessiblePropertiesSchema,\n metaAccountOverviewHandler,\n metaAccountOverviewSchema,\n metaAdAccountInfoHandler,\n metaAdAccountInfoSchema,\n metaAdsPerformanceHandler,\n metaAdsPerformanceSchema,\n metaCampaignPerformanceHandler,\n metaCampaignPerformanceSchema,\n metaListAccessibleAdAccountsHandler,\n metaListAccessibleAdAccountsSchema,\n metaListAccessibleBusinessesHandler,\n metaListAccessibleBusinessesSchema,\n metaPlacementMixHandler,\n metaPlacementMixSchema,\n metaTimeSeriesHandler,\n metaTimeSeriesSchema,\n searchConsoleCountryBreakdownHandler,\n searchConsoleCountryBreakdownSchema,\n searchConsoleDeviceBreakdownHandler,\n searchConsoleDeviceBreakdownSchema,\n searchConsoleHighImpressionLowClickQueriesHandler,\n searchConsoleHighImpressionLowClickQueriesSchema,\n searchConsoleLowCtrOpportunitiesHandler,\n searchConsoleLowCtrOpportunitiesSchema,\n searchConsolePagePerformanceHandler,\n searchConsolePagePerformanceSchema,\n searchConsoleProductDemandLowCaptureQueriesHandler,\n searchConsoleProductDemandLowCaptureQueriesSchema,\n searchConsoleQueryPageMatrixHandler,\n searchConsoleQueryPageMatrixSchema,\n searchConsoleQueryPerformanceHandler,\n searchConsoleQueryPerformanceSchema,\n searchConsoleQuickWinOpportunitiesHandler,\n searchConsoleQuickWinOpportunitiesSchema,\n searchConsoleRisingNonBrandQueriesHandler,\n searchConsoleRisingNonBrandQueriesSchema,\n searchConsoleSearchPerformanceHandler,\n searchConsoleSearchPerformanceSchema,\n searchConsoleSiteContextHandler,\n searchConsoleSiteContextSchema,\n searchConsoleVisibilityDeclinesHandler,\n searchConsoleVisibilityDeclinesSchema,\n orderDetailsHandler,\n orderDetailsSchema,\n ordersSummaryHandler,\n ordersSummarySchema,\n propertyInfoHandler,\n propertyInfoSchema,\n productOffersHandler,\n productOffersSchema,\n revenueByChannelHandler,\n revenueByChannelSchema,\n revenueOverviewHandler,\n revenueOverviewSchema,\n revenueTrendHandler,\n revenueTrendSchema,\n skuOffersHandler,\n skuOffersSchema,\n toggleUnlimitedQuantityHandler,\n toggleUnlimitedQuantitySchema,\n skuPriceHandler,\n skuPriceSchema,\n sourceMediumBreakdownHandler,\n sourceMediumBreakdownSchema,\n topLandingPagesHandler,\n topLandingPagesSchema,\n updateInventoryHandler,\n updateInventorySchema,\n updateLeadTimeHandler,\n updateLeadTimeSchema,\n updateProductBasicFieldsHandler,\n updateProductBasicFieldsSchema,\n updateSkuBasicFieldsHandler,\n updateSkuBasicFieldsSchema,\n updateSkuPriceHandler,\n updateSkuPriceSchema,\n upsertFixedPriceHandler,\n upsertFixedPriceSchema,\n warehouseInventoryHandler,\n warehouseInventorySchema,\n} from \"./src/tools/index.js\";\nimport {\n meliAnswerQuestionHandler,\n meliAnswerQuestionSchema,\n meliCreateItemHandler,\n meliCreateItemSchema,\n meliEstimateListingFeeHandler,\n meliEstimateListingFeeSchema,\n meliGetAccountContextHandler,\n meliGetAccountContextSchema,\n meliGetCategoryRequirementsHandler,\n meliGetCategoryRequirementsSchema,\n meliGetItemDetailsHandler,\n meliGetItemDetailsSchema,\n meliGetItemVisitsHandler,\n meliGetItemVisitsSchema,\n meliGetListingQualityHandler,\n meliGetListingQualitySchema,\n meliGetOrderDetailsHandler,\n meliGetOrderDetailsSchema,\n meliGetOrdersSummaryHandler,\n meliGetOrdersSummarySchema,\n meliGetSalesByItemHandler,\n meliGetSalesByItemSchema,\n meliGetSalesTrendHandler,\n meliGetSalesTrendSchema,\n meliGetShippingSummaryHandler,\n meliGetShippingSummarySchema,\n meliGetStorePerformanceHandler,\n meliGetStorePerformanceSchema,\n meliPauseOrReactivateItemHandler,\n meliPauseOrReactivateItemSchema,\n meliPredictCategoryHandler,\n meliPredictCategorySchema,\n meliSearchItemsHandler,\n meliSearchItemsSchema,\n meliSearchQuestionsHandler,\n meliSearchQuestionsSchema,\n meliUpdateItemBasicFieldsHandler,\n meliUpdateItemBasicFieldsSchema,\n meliUpdateItemDescriptionHandler,\n meliUpdateItemDescriptionSchema,\n meliUpdateItemPicturesHandler,\n meliUpdateItemPicturesSchema,\n meliValidateConnectionHandler,\n meliValidateConnectionSchema,\n} from \"./src/tools/index.js\";\n\nconst server = new MCPServer({\n name: \"bi-mcp\",\n title: \"BI MCP\",\n version: \"1.0.0\",\n description:\n \"Business Intelligence MCP server with VTEX, Google, and Meta Ads tools for ecommerce analysis.\",\n baseUrl: process.env.MCP_URL || \"http://localhost:3000\",\n favicon: \"favicon.ico\",\n icons: [\n {\n src: \"icon.svg\",\n mimeType: \"image/svg+xml\",\n sizes: [\"512x512\"],\n },\n ],\n});\n\nserver.tool(\n {\n name: \"meta_list_accessible_businesses\",\n description:\n \"List Meta businesses accessible with the configured token, useful for onboarding and permission validation.\",\n schema: metaListAccessibleBusinessesSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n metaListAccessibleBusinessesHandler\n);\n\nserver.tool(\n {\n name: \"meta_list_accessible_ad_accounts\",\n description:\n \"List Meta ad accounts accessible with the configured token, including IDs, currencies, business context, and status.\",\n schema: metaListAccessibleAdAccountsSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n metaListAccessibleAdAccountsHandler\n);\n\nserver.tool(\n {\n name: \"meta_get_ad_account_info\",\n description:\n \"Get summary information for one Meta ad account, including name, currency, timezone, business, and account status.\",\n schema: metaAdAccountInfoSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n metaAdAccountInfoHandler\n);\n\nserver.tool(\n {\n name: \"meta_get_account_overview\",\n description:\n \"Get a Meta Ads overview for one or more ad accounts over a date range, including spend, clicks, impressions, purchases, purchase value, CPC, CPM, and ROAS.\",\n schema: metaAccountOverviewSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n metaAccountOverviewHandler\n);\n\nserver.tool(\n {\n name: \"meta_get_campaign_performance\",\n description:\n \"Get Meta Ads campaign-level performance for one or more ad accounts over a date range with spend, clicks, impressions, purchases, purchase value, CPC, CPM, and ROAS.\",\n schema: metaCampaignPerformanceSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n metaCampaignPerformanceHandler\n);\n\nserver.tool(\n {\n name: \"meta_get_ads_performance\",\n description:\n \"Get Meta Ads ad-level performance for one or more ad accounts over a date range, useful for creative review and performance diagnostics.\",\n schema: metaAdsPerformanceSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n metaAdsPerformanceHandler\n);\n\nserver.tool(\n {\n name: \"meta_get_time_series\",\n description:\n \"Get a Meta Ads time series for one or more ad accounts over a date range, with daily, weekly, or monthly granularity.\",\n schema: metaTimeSeriesSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n metaTimeSeriesHandler\n);\n\nserver.tool(\n {\n name: \"meta_get_placement_mix\",\n description:\n \"Get Meta Ads placement mix for one or more ad accounts over a date range, including publisher platform and platform position performance.\",\n schema: metaPlacementMixSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n metaPlacementMixHandler\n);\n\nserver.tool(\n {\n name: \"vtex_get_orders_summary\",\n description: \"Get aggregated orders summary by date range with currency-aware BI metrics.\",\n schema: ordersSummarySchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n ordersSummaryHandler\n);\n\nserver.tool(\n {\n name: \"vtex_get_order_details\",\n description: \"Get BI-focused detailed information for one or more orders.\",\n schema: orderDetailsSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n orderDetailsHandler\n);\n\nserver.tool(\n {\n name: \"vtex_check_inventory\",\n description: \"Check global SKU inventory and infer stock health status.\",\n schema: inventoryCheckSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n inventoryCheckHandler\n);\n\nserver.tool(\n {\n name: \"vtex_get_warehouse_inventory\",\n description: \"Get SKU inventory details for a specific warehouse.\",\n schema: warehouseInventorySchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n warehouseInventoryHandler\n);\n\nserver.tool(\n {\n name: \"vtex_update_inventory\",\n description:\n \"Update the stock quantity and unlimited-quantity mode for one SKU in one warehouse. This overwrites the current quantity and availability mode stored in VTEX for that warehouse.\",\n schema: updateInventorySchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n updateInventoryHandler\n);\n\nserver.tool(\n {\n name: \"vtex_update_lead_time\",\n description:\n \"Update the lead time for one SKU in one warehouse. This overwrites the current lead time value in VTEX for that warehouse.\",\n schema: updateLeadTimeSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n updateLeadTimeHandler\n);\n\nserver.tool(\n {\n name: \"vtex_toggle_unlimited_quantity\",\n description:\n \"Toggle only the unlimited-quantity mode for one SKU in one warehouse. This keeps the current stock quantity and overwrites only the unlimited availability flag.\",\n schema: toggleUnlimitedQuantitySchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n toggleUnlimitedQuantityHandler\n);\n\nserver.tool(\n {\n name: \"vtex_update_sku_price\",\n description:\n \"Update base pricing fields for one SKU in VTEX Pricing. This can overwrite base price, list price, cost price, markup, and, if fixedPrices is sent, it also replaces any fixed prices not included in the payload.\",\n schema: updateSkuPriceSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n updateSkuPriceHandler\n);\n\nserver.tool(\n {\n name: \"vtex_upsert_fixed_price\",\n description:\n \"Create or replace fixed prices for one SKU inside one price table or trade policy. The provided fixed prices overwrite the current entries for that price table.\",\n schema: upsertFixedPriceSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n upsertFixedPriceHandler\n);\n\nserver.tool(\n {\n name: \"vtex_delete_fixed_price\",\n description:\n \"Delete all fixed prices configured for one SKU inside one price table or trade policy.\",\n schema: deleteFixedPriceSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n deleteFixedPriceHandler\n);\n\nserver.tool(\n {\n name: \"vtex_activate_sku\",\n description:\n \"Activate one SKU by setting its active flag to true. This updates the SKU record in VTEX and preserves the current operational fields.\",\n schema: activateSkuSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n activateSkuHandler\n);\n\nserver.tool(\n {\n name: \"vtex_deactivate_sku\",\n description:\n \"Deactivate one SKU by setting its active flag to false. This updates the SKU record in VTEX and preserves the current operational fields.\",\n schema: deactivateSkuSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n deactivateSkuHandler\n);\n\nserver.tool(\n {\n name: \"vtex_update_product_basic_fields\",\n description:\n \"Update core product fields such as name, description, category, brand, visibility, and SEO fields. Only the provided fields are changed; the tool keeps the current VTEX values for the rest.\",\n schema: updateProductBasicFieldsSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n updateProductBasicFieldsHandler\n);\n\nserver.tool(\n {\n name: \"vtex_update_sku_basic_fields\",\n description:\n \"Update core SKU fields such as name, reference, EAN, dimensions, weight, measurement unit, and active flags. Only the provided fields are changed; the tool keeps the current VTEX values for the rest.\",\n schema: updateSkuBasicFieldsSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n updateSkuBasicFieldsHandler\n);\n\nserver.tool(\n {\n name: \"vtex_create_product\",\n description:\n \"Create one product in VTEX Catalog. You can point it to existing category and brand IDs, or ask VTEX Catalog to use categoryPath and brandName when those entities are not already mapped.\",\n schema: createProductSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n createProductHandler\n);\n\nserver.tool(\n {\n name: \"vtex_create_sku\",\n description:\n \"Create one SKU under an existing VTEX product. This creates the SKU record and can optionally attach one EAN after creation.\",\n schema: createSkuSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n createSkuHandler\n);\n\nserver.tool(\n {\n name: \"vtex_create_product_with_sku\",\n description:\n \"Create one VTEX product and one SKU in a single operation. Use this when the product does not exist yet and you want the initial SKU created immediately after the product.\",\n schema: createProductWithSkuSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n createProductWithSkuHandler\n);\n\nserver.tool(\n {\n name: \"vtex_create_brand\",\n description:\n \"Create one brand in VTEX Catalog using the official brand contract. This creates the brand record and returns the created brand payload.\",\n schema: createBrandSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n createBrandHandler\n);\n\nserver.tool(\n {\n name: \"vtex_create_category\",\n description:\n \"Create one category in VTEX Catalog. This writes a new category record and can be used for top-level or child categories depending on fatherCategoryId.\",\n schema: createCategorySchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n createCategoryHandler\n);\n\nserver.tool(\n {\n name: \"vtex_create_specification\",\n description:\n \"Create one specification field in VTEX Catalog, including its field type, group, and visibility flags.\",\n schema: createSpecificationSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n createSpecificationHandler\n);\n\nserver.tool(\n {\n name: \"vtex_create_specification_value\",\n description:\n \"Create one specification value for an existing VTEX specification field.\",\n schema: createSpecificationValueSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n createSpecificationValueHandler\n);\n\nserver.tool(\n {\n name: \"vtex_associate_specification\",\n description:\n \"Associate one specification to one product or one SKU. This writes a single specification association using either a fieldValueId or raw text, depending on the field type.\",\n schema: associateSpecificationSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n associateSpecificationHandler\n);\n\nserver.tool(\n {\n name: \"vtex_attach_catalog_image\",\n description:\n \"Attach one catalog image to one SKU using a public image URL. This adds a new SKU file entry in VTEX Catalog.\",\n schema: attachCatalogImageSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n attachCatalogImageHandler\n);\n\nserver.tool(\n {\n name: \"vtex_cancel_order\",\n description:\n \"Cancel one order in VTEX Orders API. Before using this tool, the assistant must explain what will be canceled, mention that invoiced orders cannot be canceled and cancellations cannot be reversed, and obtain explicit confirmation from the user. Only then should the tool be called with confirmed=true.\",\n schema: cancelOrderSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n cancelOrderHandler\n);\n\nserver.tool(\n {\n name: \"vtex_invoice_order\",\n description:\n \"Invoice one order in VTEX Orders API. Before using this tool, the assistant must explain that invoicing changes the order's logistics and financial state, mention that the tool writes invoice data into VTEX, and obtain explicit confirmation from the user. Only then should the tool be called with confirmed=true.\",\n schema: invoiceOrderSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n invoiceOrderHandler\n);\n\nserver.tool(\n {\n name: \"vtex_add_order_tracking\",\n description:\n \"Add tracking data to one invoiced order in VTEX. Before using this tool, the assistant must explain which invoice and tracking data will be updated, mention that this affects the operational communication sent to the customer, and obtain explicit confirmation from the user. Only then should the tool be called with confirmed=true.\",\n schema: addOrderTrackingSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n addOrderTrackingHandler\n);\n\nserver.tool(\n {\n name: \"vtex_get_sku_price\",\n description: \"Get base pricing information for one SKU.\",\n schema: skuPriceSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n skuPriceHandler\n);\n\nserver.tool(\n {\n name: \"vtex_get_computed_price\",\n description: \"Get computed SKU price by price table context.\",\n schema: computedPriceSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n computedPriceHandler\n);\n\nserver.tool(\n {\n name: \"vtex_get_product_offers\",\n description: \"Get offers for all SKUs under a product.\",\n schema: productOffersSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n productOffersHandler\n);\n\nserver.tool(\n {\n name: \"vtex_get_sku_offers\",\n description: \"Get offers for a specific SKU under a product.\",\n schema: skuOffersSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n skuOffersHandler\n);\n\nserver.tool(\n {\n name: \"config_check_database_connection\",\n description:\n \"Check whether the MCP can reach its configured database and whether critical tables are present.\",\n schema: checkDatabaseConnectionSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: false,\n },\n },\n checkDatabaseConnectionHandler\n);\n\nserver.tool(\n {\n name: \"config_list_profiles\",\n description: \"List client profiles currently available in the MCP database.\",\n schema: listProfilesSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: false,\n },\n },\n listProfilesHandler\n);\n\nserver.tool(\n {\n name: \"config_get_benchmarks\",\n description:\n \"Devuelve benchmarks de Argentina para c\u00E1lculos financieros: IIBB por provincia, costos de cuotas sin inter\u00E9s (Ahora 12, Plan Z), fees de pasarelas de pago (Mercado Pago, Mobbex, Payway, dLocal), costos log\u00EDsticos por zona y calendario comercial con impacto de revenue.\",\n schema: getBenchmarksSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: false,\n },\n },\n getBenchmarksHandler\n);\n\nserver.tool(\n {\n name: \"gads_get_channel_mix\",\n description:\n \"Get Google Ads mix by advertising channel type for a date range, including spend, clicks, impressions, conversions, conversion value, and channel share.\",\n schema: googleAdsChannelMixSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n googleAdsChannelMixHandler\n);\n\nserver.tool(\n {\n name: \"gads_get_customer_info\",\n description:\n \"Get summary information for one Google Ads customer account, including name, currency, timezone, and whether the account is a manager (MCC).\",\n schema: googleAdsCustomerInfoSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n googleAdsCustomerInfoHandler\n);\n\nserver.tool(\n {\n name: \"gads_list_customer_clients\",\n description:\n \"List visible child accounts for a Google Ads customer account, usually used to inspect manager (MCC) account structure.\",\n schema: googleAdsCustomerClientsSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n googleAdsCustomerClientsHandler\n);\n\nserver.tool(\n {\n name: \"gads_get_account_overview\",\n description:\n \"Get a Google Ads account overview for a date range, including spend, clicks, impressions, conversions, conversion value, CTR, CPC, CPA, and ROAS.\",\n schema: googleAdsAccountOverviewSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n googleAdsAccountOverviewHandler\n);\n\nserver.tool(\n {\n name: \"gads_get_campaign_performance\",\n description:\n \"Get Google Ads campaign-level performance for a date range with spend, clicks, impressions, conversions, conversion value, CTR, CPC, CPA, and ROAS.\",\n schema: googleAdsCampaignPerformanceSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n googleAdsCampaignPerformanceHandler\n);\n\nserver.tool(\n {\n name: \"gads_get_time_series\",\n description:\n \"Get Google Ads daily or weekly time series for a date range with spend, clicks, impressions, conversions, conversion value, CPA, and ROAS.\",\n schema: googleAdsTimeSeriesSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n googleAdsTimeSeriesHandler\n);\n\nserver.tool(\n {\n name: \"gads_get_search_terms_summary\",\n description:\n \"Get a ranked summary of Google Ads search terms for a date range, including spend, clicks, impressions, conversions, conversion value, CPA, and ROAS.\",\n schema: googleAdsSearchTermsSummarySchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n googleAdsSearchTermsSummaryHandler\n);\n\nserver.tool(\n {\n name: \"gads_get_account_risks\",\n description:\n \"Evaluate Google Ads account risks for a date range, including concentration, low efficiency, weak conversion volume, and recent deterioration signals.\",\n schema: googleAdsAccountRisksSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n googleAdsAccountRisksHandler\n);\n\nserver.tool(\n {\n name: \"gads_get_break_even_analysis\",\n description:\n \"Compare current Google Ads performance against a user-provided break-even ROAS and optional CPA target.\",\n schema: googleAdsBreakEvenAnalysisSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n googleAdsBreakEvenAnalysisHandler\n);\n\nserver.tool(\n {\n name: \"gads_get_scaling_health\",\n description:\n \"Assess whether a Google Ads account is ready to scale using break-even ROAS, optional CPA target, concentration, stability, and conversion volume.\",\n schema: googleAdsScalingHealthSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n googleAdsScalingHealthHandler\n);\n\nserver.tool(\n {\n name: \"gads_compare_accounts\",\n description:\n \"Compare multiple Google Ads accounts across the same date range and rank them by basic risk and efficiency signals.\",\n schema: googleAdsCompareAccountsSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n googleAdsCompareAccountsHandler\n);\n\nserver.tool(\n {\n name: \"gsc_list_accessible_sites\",\n description: \"List all Search Console sites accessible with the configured Google credentials.\",\n schema: listAccessibleSitesSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n listAccessibleSitesHandler\n);\n\nserver.tool(\n {\n name: \"gsc_get_site_context\",\n description: \"Validate one Search Console site and return the resolved site context used by the module.\",\n schema: searchConsoleSiteContextSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n searchConsoleSiteContextHandler\n);\n\nserver.tool(\n {\n name: \"gsc_get_search_performance\",\n description: \"Run a flexible Search Console performance query with custom dimensions and filters.\",\n schema: searchConsoleSearchPerformanceSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n searchConsoleSearchPerformanceHandler\n);\n\nserver.tool(\n {\n name: \"gsc_get_query_performance\",\n description: \"Get Search Console performance grouped by search query for a date range.\",\n schema: searchConsoleQueryPerformanceSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n searchConsoleQueryPerformanceHandler\n);\n\nserver.tool(\n {\n name: \"gsc_get_page_performance\",\n description: \"Get Search Console performance grouped by landing page for a date range.\",\n schema: searchConsolePagePerformanceSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n searchConsolePagePerformanceHandler\n);\n\nserver.tool(\n {\n name: \"gsc_get_query_page_matrix\",\n description: \"Get a Search Console matrix crossing queries and landing pages for a date range.\",\n schema: searchConsoleQueryPageMatrixSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n searchConsoleQueryPageMatrixHandler\n);\n\nserver.tool(\n {\n name: \"gsc_get_device_breakdown\",\n description: \"Break down Search Console performance by device for a date range.\",\n schema: searchConsoleDeviceBreakdownSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n searchConsoleDeviceBreakdownHandler\n);\n\nserver.tool(\n {\n name: \"gsc_get_country_breakdown\",\n description: \"Break down Search Console performance by country for a date range.\",\n schema: searchConsoleCountryBreakdownSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n searchConsoleCountryBreakdownHandler\n);\n\nserver.tool(\n {\n name: \"gsc_find_high_impression_low_click_queries\",\n description: \"Find queries with high Search Console impression volume but weak click capture.\",\n schema: searchConsoleHighImpressionLowClickQueriesSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n searchConsoleHighImpressionLowClickQueriesHandler\n);\n\nserver.tool(\n {\n name: \"gsc_find_low_ctr_opportunities\",\n description: \"Find Search Console queries that rank reasonably well but underperform on CTR.\",\n schema: searchConsoleLowCtrOpportunitiesSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n searchConsoleLowCtrOpportunitiesHandler\n);\n\nserver.tool(\n {\n name: \"gsc_detect_visibility_declines\",\n description: \"Detect Search Console pages that are losing visibility between two periods.\",\n schema: searchConsoleVisibilityDeclinesSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n searchConsoleVisibilityDeclinesHandler\n);\n\nserver.tool(\n {\n name: \"gsc_find_product_demand_low_capture_queries\",\n description: \"Find product-intent queries with demand in Search Console but weak click capture.\",\n schema: searchConsoleProductDemandLowCaptureQueriesSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n searchConsoleProductDemandLowCaptureQueriesHandler\n);\n\nserver.tool(\n {\n name: \"gsc_find_rising_non_brand_queries\",\n description: \"Find non-branded Search Console queries growing between two periods.\",\n schema: searchConsoleRisingNonBrandQueriesSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n searchConsoleRisingNonBrandQueriesHandler\n);\n\nserver.tool(\n {\n name: \"gsc_find_quick_win_opportunities\",\n description: \"Prioritize Search Console quick wins across CTR improvements and ranking gains.\",\n schema: searchConsoleQuickWinOpportunitiesSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n searchConsoleQuickWinOpportunitiesHandler\n);\n\nserver.tool(\n {\n name: \"ga4_list_accessible_properties\",\n description: \"List all Google Analytics 4 accounts and properties accessible with the configured OAuth credentials.\",\n schema: listAccessiblePropertiesSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n listAccessiblePropertiesHandler\n);\n\nserver.tool(\n {\n name: \"ga4_get_property_info\",\n description: \"Get summary information and capabilities for one GA4 property, including ecommerce and attribution support.\",\n schema: propertyInfoSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n propertyInfoHandler\n);\n\nserver.tool(\n {\n name: \"ga4_get_channel_mix\",\n description: \"Get traffic mix by default channel group with shares of sessions and users for a date range.\",\n schema: channelMixSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n channelMixHandler\n);\n\nserver.tool(\n {\n name: \"ga4_get_source_medium_breakdown\",\n description: \"Get traffic breakdown by session source / medium with session and user share for a date range.\",\n schema: sourceMediumBreakdownSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n sourceMediumBreakdownHandler\n);\n\nserver.tool(\n {\n name: \"ga4_get_revenue_overview\",\n description: \"Get GA4 ecommerce overview for a date range including transactions, revenue, purchasers, and rates.\",\n schema: revenueOverviewSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n revenueOverviewHandler\n);\n\nserver.tool(\n {\n name: \"ga4_get_revenue_trend\",\n description: \"Get daily GA4 revenue and transactions trend for a date range.\",\n schema: revenueTrendSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n revenueTrendHandler\n);\n\nserver.tool(\n {\n name: \"ga4_get_revenue_by_channel\",\n description: \"Get GA4 revenue and transactions by default channel group for a date range.\",\n schema: revenueByChannelSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n revenueByChannelHandler\n);\n\nserver.tool(\n {\n name: \"ga4_get_top_landing_pages\",\n description: \"Get top landing pages by sessions and users for a date range.\",\n schema: topLandingPagesSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n topLandingPagesHandler\n);\n\nserver.tool(\n {\n name: \"ga4_get_engagement_overview\",\n description: \"Get GA4 engagement metrics for a date range, including engagement rate, bounce rate, and session duration.\",\n schema: engagementOverviewSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n engagementOverviewHandler\n);\n\nserver.tool(\n {\n name: \"ga4_detect_attribution_gaps\",\n description: \"Detect unattributed traffic, unassigned channels, and not-set source / medium values in GA4.\",\n schema: attributionGapsSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n attributionGapsHandler\n);\n\nserver.tool(\n {\n name: \"ga4_check_ecommerce_tracking_health\",\n description: \"Evaluate whether GA4 ecommerce tracking appears complete by checking item views, carts, checkouts, purchases, and refunds.\",\n schema: ecommerceTrackingHealthSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n ecommerceTrackingHealthHandler\n);\n\nserver.tool(\n {\n name: \"meli_get_account_context\",\n description: \"Get MercadoLibre account context for the selected profile, including seller id, nickname, scopes, and token expiry.\",\n schema: meliGetAccountContextSchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliGetAccountContextHandler\n);\n\nserver.tool(\n {\n name: \"meli_validate_connection\",\n description: \"Validate the MercadoLibre connection for a profile, refreshing tokens if needed and returning the resulting status.\",\n schema: meliValidateConnectionSchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliValidateConnectionHandler\n);\n\nserver.tool(\n {\n name: \"meli_get_orders_summary\",\n description: \"Get MercadoLibre order KPIs or compact order detail chunks for a date range. For reports, summaries, calculations, analysis, KPIs, metrics, performance, revenue, cancellations, refunds, discounts, shipping, trends, flows, or SKU economics, default to responseMode=calculations (calculations-only output, no order rows). Use responseMode=orders_chunk only when the user explicitly needs order-level detail or a question cannot be answered from calculations; it returns up to 15 pages of compact order rows with continuation metadata so the model can fetch more chunks if needed.\",\n schema: meliGetOrdersSummarySchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliGetOrdersSummaryHandler\n);\n\nserver.tool(\n {\n name: \"meli_get_order_details\",\n description: \"Get MercadoLibre order details for one or more order ids with partial-failure handling.\",\n schema: meliGetOrderDetailsSchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliGetOrderDetailsHandler\n);\n\nserver.tool(\n {\n name: \"meli_get_sales_by_item\",\n description: \"Aggregate MercadoLibre sales by item and variation for a date range, split by currency.\",\n schema: meliGetSalesByItemSchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliGetSalesByItemHandler\n);\n\nserver.tool(\n {\n name: \"meli_get_sales_trend\",\n description: \"Build a MercadoLibre sales trend by day or week for a date range, split by currency.\",\n schema: meliGetSalesTrendSchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliGetSalesTrendHandler\n);\n\nserver.tool(\n {\n name: \"meli_get_shipping_summary\",\n description: \"Summarize MercadoLibre shipment statuses, substatuses, and shipping costs from recent orders.\",\n schema: meliGetShippingSummarySchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliGetShippingSummaryHandler\n);\n\nserver.tool(\n {\n name: \"meli_get_item_visits\",\n description: \"Get MercadoLibre visits totals for seller-level date ranges or item-level time windows.\",\n schema: meliGetItemVisitsSchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliGetItemVisitsHandler\n);\n\nserver.tool(\n {\n name: \"meli_get_store_performance\",\n description: \"Combine MercadoLibre orders, items, and visits into an executive store performance summary.\",\n schema: meliGetStorePerformanceSchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliGetStorePerformanceHandler\n);\n\nserver.tool(\n {\n name: \"meli_search_items\",\n description: \"Search MercadoLibre items for the selected seller with optional compact multiget details.\",\n schema: meliSearchItemsSchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliSearchItemsHandler\n);\n\nserver.tool(\n {\n name: \"meli_get_item_details\",\n description: \"Get MercadoLibre item details for one or more item ids with multiget and fallback batch handling.\",\n schema: meliGetItemDetailsSchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliGetItemDetailsHandler\n);\n\nserver.tool(\n {\n name: \"meli_get_listing_quality\",\n description: \"Get listing quality and performance signals for a MercadoLibre item.\",\n schema: meliGetListingQualitySchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliGetListingQualityHandler\n);\n\nserver.tool(\n {\n name: \"meli_predict_category\",\n description: \"Predict candidate MercadoLibre categories and domains from a product query.\",\n schema: meliPredictCategorySchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliPredictCategoryHandler\n);\n\nserver.tool(\n {\n name: \"meli_get_category_requirements\",\n description: \"Get MercadoLibre category attribute requirements and shipping preferences for a category.\",\n schema: meliGetCategoryRequirementsSchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliGetCategoryRequirementsHandler\n);\n\nserver.tool(\n {\n name: \"meli_estimate_listing_fee\",\n description: \"Estimate MercadoLibre selling fees and price breakdowns for a proposed listing.\",\n schema: meliEstimateListingFeeSchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliEstimateListingFeeHandler\n);\n\nserver.tool(\n {\n name: \"meli_create_item\",\n description: \"Create a MercadoLibre item directly for the selected profile, optionally publishing its description too.\",\n schema: meliCreateItemSchema,\n annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true },\n },\n meliCreateItemHandler\n);\n\nserver.tool(\n {\n name: \"meli_update_item_basic_fields\",\n description: \"Update MercadoLibre item fields such as title, price, quantity, attributes, shipping, and status.\",\n schema: meliUpdateItemBasicFieldsSchema,\n annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: true },\n },\n meliUpdateItemBasicFieldsHandler\n);\n\nserver.tool(\n {\n name: \"meli_update_item_description\",\n description: \"Create or replace the published MercadoLibre plain-text item description.\",\n schema: meliUpdateItemDescriptionSchema,\n annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: true },\n },\n meliUpdateItemDescriptionHandler\n);\n\nserver.tool(\n {\n name: \"meli_update_item_pictures\",\n description: \"Add or replace MercadoLibre item pictures using public image URLs.\",\n schema: meliUpdateItemPicturesSchema,\n annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: true },\n },\n meliUpdateItemPicturesHandler\n);\n\nserver.tool(\n {\n name: \"meli_pause_or_reactivate_item\",\n description: \"Pause or reactivate a MercadoLibre item by changing its listing status.\",\n schema: meliPauseOrReactivateItemSchema,\n annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: true },\n },\n meliPauseOrReactivateItemHandler\n);\n\nserver.tool(\n {\n name: \"meli_search_questions\",\n description: \"Search MercadoLibre buyer questions for the selected seller with compact pagination-aware output.\",\n schema: meliSearchQuestionsSchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliSearchQuestionsHandler\n);\n\nserver.tool(\n {\n name: \"meli_answer_question\",\n description: \"Publish a MercadoLibre answer for a specific buyer question.\",\n schema: meliAnswerQuestionSchema,\n annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true },\n },\n meliAnswerQuestionHandler\n);\n\nserver.prompt(\n {\n name: \"vtex-reporte-ventas\",\n description:\n \"Genera un prompt de reporte de ventas VTEX usando una sola entrada temporal en lenguaje natural.\",\n schema: reporteVentasPromptSchema,\n },\n reporteVentasPromptHandler\n);\n\nasync function createStdioTransportFromMcpUseDependency() {\n const requireFromHere = createRequire(import.meta.url);\n const mcpUseServerEntry = requireFromHere.resolve(\"mcp-use/server\");\n const requireFromMcpUse = createRequire(mcpUseServerEntry);\n const stdioModulePath = requireFromMcpUse.resolve(\"@modelcontextprotocol/sdk/server/stdio.js\");\n const stdioModule = (await import(pathToFileURL(stdioModulePath).href)) as {\n StdioServerTransport: new () => unknown;\n };\n\n return new stdioModule.StdioServerTransport();\n}\n\nasync function startServer() {\n const transport = (process.env.MCP_TRANSPORT ?? \"http\").trim().toLowerCase();\n\n if (transport === \"stdio\") {\n const stdioTransport = await createStdioTransportFromMcpUseDependency();\n await server.nativeServer.connect(stdioTransport as any);\n console.error(\"MCP server running on stdio transport\");\n return;\n }\n\n if (transport === \"http\") {\n const port = process.env.PORT ? Number.parseInt(process.env.PORT, 10) : 3000;\n if (Number.isNaN(port)) {\n throw new Error(`Invalid PORT value: ${process.env.PORT}`);\n }\n\n console.error(`MCP server running on http transport (port ${port})`);\n await server.listen(port);\n return;\n }\n\n throw new Error(`Invalid MCP_TRANSPORT \"${process.env.MCP_TRANSPORT}\". Use \"http\" or \"stdio\".`);\n}\n\nstartServer().catch((error) => {\n console.error(\"Failed to start MCP server\", error);\n process.exit(1);\n});\n"],
5
- "mappings": "AAAA,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,iBAAiB;AAE1B;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB,2BAA2B;AAC1D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,MAAM,SAAS,IAAI,UAAU;AAAA,EAC3B,MAAM;AAAA,EACN,OAAO;AAAA,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;AACvD,YAAQ,MAAM,uCAAuC;AACrD;AAAA,EACF;AAEA,MAAI,cAAc,QAAQ;AACxB,UAAM,OAAO,QAAQ,IAAI,OAAO,OAAO,SAAS,QAAQ,IAAI,MAAM,EAAE,IAAI;AACxE,QAAI,OAAO,MAAM,IAAI,GAAG;AACtB,YAAM,IAAI,MAAM,uBAAuB,QAAQ,IAAI,IAAI,EAAE;AAAA,IAC3D;AAEA,YAAQ,MAAM,8CAA8C,IAAI,GAAG;AACnE,UAAM,OAAO,OAAO,IAAI;AACxB;AAAA,EACF;AAEA,QAAM,IAAI,MAAM,0BAA0B,QAAQ,IAAI,aAAa,2BAA2B;AAChG;AAEA,YAAY,EAAE,MAAM,CAAC,UAAU;AAC7B,UAAQ,MAAM,8BAA8B,KAAK;AACjD,UAAQ,KAAK,CAAC;AAChB,CAAC;",
4
+ "sourcesContent": ["import { createRequire } from \"node:module\";\nimport { pathToFileURL } from \"node:url\";\nimport { MCPServer } from \"mcp-use/server\";\n\nimport {\n reporteVentasPromptHandler,\n reporteVentasPromptSchema,\n} from \"./src/prompts/reporte-ventas.js\";\nimport { getBenchmarksHandler, getBenchmarksSchema } from \"./src/config/benchmarks.js\";\nimport {\n checkDatabaseConnectionHandler,\n checkDatabaseConnectionSchema,\n listProfilesHandler,\n listProfilesSchema,\n googleAdsAccountRisksHandler,\n googleAdsAccountRisksSchema,\n googleAdsAccountOverviewHandler,\n googleAdsAccountOverviewSchema,\n googleAdsBreakEvenAnalysisHandler,\n googleAdsBreakEvenAnalysisSchema,\n googleAdsCampaignPerformanceHandler,\n googleAdsCampaignPerformanceSchema,\n googleAdsChannelMixHandler,\n googleAdsChannelMixSchema,\n googleAdsCompareAccountsHandler,\n googleAdsCompareAccountsSchema,\n googleAdsCustomerClientsHandler,\n googleAdsCustomerClientsSchema,\n googleAdsCustomerInfoHandler,\n googleAdsCustomerInfoSchema,\n googleAdsSearchTermsSummaryHandler,\n googleAdsSearchTermsSummarySchema,\n googleAdsScalingHealthHandler,\n googleAdsScalingHealthSchema,\n googleAdsTimeSeriesHandler,\n googleAdsTimeSeriesSchema,\n listAccessibleSitesHandler,\n listAccessibleSitesSchema,\n attributionGapsHandler,\n attributionGapsSchema,\n activateSkuHandler,\n activateSkuSchema,\n addOrderTrackingHandler,\n addOrderTrackingSchema,\n associateSpecificationHandler,\n associateSpecificationSchema,\n attachCatalogImageHandler,\n attachCatalogImageSchema,\n cancelOrderHandler,\n cancelOrderSchema,\n channelMixHandler,\n channelMixSchema,\n computedPriceHandler,\n computedPriceSchema,\n createBrandHandler,\n createBrandSchema,\n createCategoryHandler,\n createCategorySchema,\n createProductHandler,\n createProductSchema,\n createProductWithSkuHandler,\n createProductWithSkuSchema,\n createSkuHandler,\n createSkuSchema,\n createSpecificationHandler,\n createSpecificationSchema,\n createSpecificationValueHandler,\n createSpecificationValueSchema,\n deactivateSkuHandler,\n deactivateSkuSchema,\n deleteFixedPriceHandler,\n deleteFixedPriceSchema,\n ecommerceTrackingHealthHandler,\n ecommerceTrackingHealthSchema,\n engagementOverviewHandler,\n engagementOverviewSchema,\n invoiceOrderHandler,\n invoiceOrderSchema,\n inventoryCheckHandler,\n inventoryCheckSchema,\n listAccessiblePropertiesHandler,\n listAccessiblePropertiesSchema,\n metaAccountOverviewHandler,\n metaAccountOverviewSchema,\n metaAdAccountInfoHandler,\n metaAdAccountInfoSchema,\n metaAdsPerformanceHandler,\n metaAdsPerformanceSchema,\n metaCampaignPerformanceHandler,\n metaCampaignPerformanceSchema,\n metaListAccessibleAdAccountsHandler,\n metaListAccessibleAdAccountsSchema,\n metaListAccessibleBusinessesHandler,\n metaListAccessibleBusinessesSchema,\n metaPlacementMixHandler,\n metaPlacementMixSchema,\n metaTimeSeriesHandler,\n metaTimeSeriesSchema,\n searchConsoleCountryBreakdownHandler,\n searchConsoleCountryBreakdownSchema,\n searchConsoleDeviceBreakdownHandler,\n searchConsoleDeviceBreakdownSchema,\n searchConsoleHighImpressionLowClickQueriesHandler,\n searchConsoleHighImpressionLowClickQueriesSchema,\n searchConsoleLowCtrOpportunitiesHandler,\n searchConsoleLowCtrOpportunitiesSchema,\n searchConsolePagePerformanceHandler,\n searchConsolePagePerformanceSchema,\n searchConsoleProductDemandLowCaptureQueriesHandler,\n searchConsoleProductDemandLowCaptureQueriesSchema,\n searchConsoleQueryPageMatrixHandler,\n searchConsoleQueryPageMatrixSchema,\n searchConsoleQueryPerformanceHandler,\n searchConsoleQueryPerformanceSchema,\n searchConsoleQuickWinOpportunitiesHandler,\n searchConsoleQuickWinOpportunitiesSchema,\n searchConsoleRisingNonBrandQueriesHandler,\n searchConsoleRisingNonBrandQueriesSchema,\n searchConsoleSearchPerformanceHandler,\n searchConsoleSearchPerformanceSchema,\n searchConsoleSiteContextHandler,\n searchConsoleSiteContextSchema,\n searchConsoleVisibilityDeclinesHandler,\n searchConsoleVisibilityDeclinesSchema,\n orderDetailsHandler,\n orderDetailsSchema,\n ordersSummaryHandler,\n ordersSummarySchema,\n propertyInfoHandler,\n propertyInfoSchema,\n productOffersHandler,\n productOffersSchema,\n revenueByChannelHandler,\n revenueByChannelSchema,\n revenueOverviewHandler,\n revenueOverviewSchema,\n revenueTrendHandler,\n revenueTrendSchema,\n skuOffersHandler,\n skuOffersSchema,\n toggleUnlimitedQuantityHandler,\n toggleUnlimitedQuantitySchema,\n skuPriceHandler,\n skuPriceSchema,\n sourceMediumBreakdownHandler,\n sourceMediumBreakdownSchema,\n topLandingPagesHandler,\n topLandingPagesSchema,\n updateInventoryHandler,\n updateInventorySchema,\n updateLeadTimeHandler,\n updateLeadTimeSchema,\n updateProductBasicFieldsHandler,\n updateProductBasicFieldsSchema,\n updateSkuBasicFieldsHandler,\n updateSkuBasicFieldsSchema,\n updateSkuPriceHandler,\n updateSkuPriceSchema,\n upsertFixedPriceHandler,\n upsertFixedPriceSchema,\n warehouseInventoryHandler,\n warehouseInventorySchema,\n} from \"./src/tools/index.js\";\nimport {\n meliAnswerQuestionHandler,\n meliAnswerQuestionSchema,\n meliCreateItemHandler,\n meliCreateItemSchema,\n meliEstimateListingFeeHandler,\n meliEstimateListingFeeSchema,\n meliEstimateProductProfitabilityHandler,\n meliEstimateProductProfitabilitySchema,\n meliGetAccountContextHandler,\n meliGetAccountContextSchema,\n meliGetCategoryRequirementsHandler,\n meliGetCategoryRequirementsSchema,\n meliGetSiteCategoriesAndListingTypesHandler,\n meliGetSiteCategoriesAndListingTypesSchema,\n meliGetItemDetailsHandler,\n meliGetItemDetailsSchema,\n meliGetItemVisitsHandler,\n meliGetItemVisitsSchema,\n meliGetListingQualityHandler,\n meliGetListingQualitySchema,\n meliGetOrderDetailsHandler,\n meliGetOrderDetailsSchema,\n meliGetOrdersSummaryHandler,\n meliGetOrdersSummarySchema,\n meliGetSalesByItemHandler,\n meliGetSalesByItemSchema,\n meliGetSalesTrendHandler,\n meliGetSalesTrendSchema,\n meliGetShippingSummaryHandler,\n meliGetShippingSummarySchema,\n meliGetStorePerformanceHandler,\n meliGetStorePerformanceSchema,\n meliPauseOrReactivateItemHandler,\n meliPauseOrReactivateItemSchema,\n meliPredictCategoryHandler,\n meliPredictCategorySchema,\n meliSearchItemsHandler,\n meliSearchItemsSchema,\n meliSearchQuestionsHandler,\n meliSearchQuestionsSchema,\n meliUpdateItemBasicFieldsHandler,\n meliUpdateItemBasicFieldsSchema,\n meliUpdateItemDescriptionHandler,\n meliUpdateItemDescriptionSchema,\n meliUpdateItemPicturesHandler,\n meliUpdateItemPicturesSchema,\n meliValidateConnectionHandler,\n meliValidateConnectionSchema,\n} from \"./src/tools/index.js\";\n\nconst server = new MCPServer({\n name: \"bi-mcp\",\n title: \"BI MCP\",\n version: \"1.0.0\",\n description:\n \"Business Intelligence MCP server with VTEX, Google, and Meta Ads tools for ecommerce analysis.\",\n baseUrl: process.env.MCP_URL || \"http://localhost:3000\",\n favicon: \"favicon.ico\",\n icons: [\n {\n src: \"icon.svg\",\n mimeType: \"image/svg+xml\",\n sizes: [\"512x512\"],\n },\n ],\n});\n\nserver.tool(\n {\n name: \"meta_list_accessible_businesses\",\n description:\n \"List Meta businesses accessible with the configured token, useful for onboarding and permission validation.\",\n schema: metaListAccessibleBusinessesSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n metaListAccessibleBusinessesHandler\n);\n\nserver.tool(\n {\n name: \"meta_list_accessible_ad_accounts\",\n description:\n \"List Meta ad accounts accessible with the configured token, including IDs, currencies, business context, and status.\",\n schema: metaListAccessibleAdAccountsSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n metaListAccessibleAdAccountsHandler\n);\n\nserver.tool(\n {\n name: \"meta_get_ad_account_info\",\n description:\n \"Get summary information for one Meta ad account, including name, currency, timezone, business, and account status.\",\n schema: metaAdAccountInfoSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n metaAdAccountInfoHandler\n);\n\nserver.tool(\n {\n name: \"meta_get_account_overview\",\n description:\n \"Get a Meta Ads overview for one or more ad accounts over a date range, including spend, clicks, impressions, purchases, purchase value, CPC, CPM, and ROAS.\",\n schema: metaAccountOverviewSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n metaAccountOverviewHandler\n);\n\nserver.tool(\n {\n name: \"meta_get_campaign_performance\",\n description:\n \"Get Meta Ads campaign-level performance for one or more ad accounts over a date range with spend, clicks, impressions, purchases, purchase value, CPC, CPM, and ROAS.\",\n schema: metaCampaignPerformanceSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n metaCampaignPerformanceHandler\n);\n\nserver.tool(\n {\n name: \"meta_get_ads_performance\",\n description:\n \"Get Meta Ads ad-level performance for one or more ad accounts over a date range, useful for creative review and performance diagnostics.\",\n schema: metaAdsPerformanceSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n metaAdsPerformanceHandler\n);\n\nserver.tool(\n {\n name: \"meta_get_time_series\",\n description:\n \"Get a Meta Ads time series for one or more ad accounts over a date range, with daily, weekly, or monthly granularity.\",\n schema: metaTimeSeriesSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n metaTimeSeriesHandler\n);\n\nserver.tool(\n {\n name: \"meta_get_placement_mix\",\n description:\n \"Get Meta Ads placement mix for one or more ad accounts over a date range, including publisher platform and platform position performance.\",\n schema: metaPlacementMixSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n metaPlacementMixHandler\n);\n\nserver.tool(\n {\n name: \"vtex_get_orders_summary\",\n description: \"Get aggregated orders summary by date range with currency-aware BI metrics.\",\n schema: ordersSummarySchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n ordersSummaryHandler\n);\n\nserver.tool(\n {\n name: \"vtex_get_order_details\",\n description: \"Get BI-focused detailed information for one or more orders.\",\n schema: orderDetailsSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n orderDetailsHandler\n);\n\nserver.tool(\n {\n name: \"vtex_check_inventory\",\n description: \"Check global SKU inventory and infer stock health status.\",\n schema: inventoryCheckSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n inventoryCheckHandler\n);\n\nserver.tool(\n {\n name: \"vtex_get_warehouse_inventory\",\n description: \"Get SKU inventory details for a specific warehouse.\",\n schema: warehouseInventorySchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n warehouseInventoryHandler\n);\n\nserver.tool(\n {\n name: \"vtex_update_inventory\",\n description:\n \"Update the stock quantity and unlimited-quantity mode for one SKU in one warehouse. This overwrites the current quantity and availability mode stored in VTEX for that warehouse.\",\n schema: updateInventorySchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n updateInventoryHandler\n);\n\nserver.tool(\n {\n name: \"vtex_update_lead_time\",\n description:\n \"Update the lead time for one SKU in one warehouse. This overwrites the current lead time value in VTEX for that warehouse.\",\n schema: updateLeadTimeSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n updateLeadTimeHandler\n);\n\nserver.tool(\n {\n name: \"vtex_toggle_unlimited_quantity\",\n description:\n \"Toggle only the unlimited-quantity mode for one SKU in one warehouse. This keeps the current stock quantity and overwrites only the unlimited availability flag.\",\n schema: toggleUnlimitedQuantitySchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n toggleUnlimitedQuantityHandler\n);\n\nserver.tool(\n {\n name: \"vtex_update_sku_price\",\n description:\n \"Update base pricing fields for one SKU in VTEX Pricing. This can overwrite base price, list price, cost price, markup, and, if fixedPrices is sent, it also replaces any fixed prices not included in the payload.\",\n schema: updateSkuPriceSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n updateSkuPriceHandler\n);\n\nserver.tool(\n {\n name: \"vtex_upsert_fixed_price\",\n description:\n \"Create or replace fixed prices for one SKU inside one price table or trade policy. The provided fixed prices overwrite the current entries for that price table.\",\n schema: upsertFixedPriceSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n upsertFixedPriceHandler\n);\n\nserver.tool(\n {\n name: \"vtex_delete_fixed_price\",\n description:\n \"Delete all fixed prices configured for one SKU inside one price table or trade policy.\",\n schema: deleteFixedPriceSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n deleteFixedPriceHandler\n);\n\nserver.tool(\n {\n name: \"vtex_activate_sku\",\n description:\n \"Activate one SKU by setting its active flag to true. This updates the SKU record in VTEX and preserves the current operational fields.\",\n schema: activateSkuSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n activateSkuHandler\n);\n\nserver.tool(\n {\n name: \"vtex_deactivate_sku\",\n description:\n \"Deactivate one SKU by setting its active flag to false. This updates the SKU record in VTEX and preserves the current operational fields.\",\n schema: deactivateSkuSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n deactivateSkuHandler\n);\n\nserver.tool(\n {\n name: \"vtex_update_product_basic_fields\",\n description:\n \"Update core product fields such as name, description, category, brand, visibility, and SEO fields. Only the provided fields are changed; the tool keeps the current VTEX values for the rest.\",\n schema: updateProductBasicFieldsSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n updateProductBasicFieldsHandler\n);\n\nserver.tool(\n {\n name: \"vtex_update_sku_basic_fields\",\n description:\n \"Update core SKU fields such as name, reference, EAN, dimensions, weight, measurement unit, and active flags. Only the provided fields are changed; the tool keeps the current VTEX values for the rest.\",\n schema: updateSkuBasicFieldsSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n updateSkuBasicFieldsHandler\n);\n\nserver.tool(\n {\n name: \"vtex_create_product\",\n description:\n \"Create one product in VTEX Catalog. You can point it to existing category and brand IDs, or ask VTEX Catalog to use categoryPath and brandName when those entities are not already mapped.\",\n schema: createProductSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n createProductHandler\n);\n\nserver.tool(\n {\n name: \"vtex_create_sku\",\n description:\n \"Create one SKU under an existing VTEX product. This creates the SKU record and can optionally attach one EAN after creation.\",\n schema: createSkuSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n createSkuHandler\n);\n\nserver.tool(\n {\n name: \"vtex_create_product_with_sku\",\n description:\n \"Create one VTEX product and one SKU in a single operation. Use this when the product does not exist yet and you want the initial SKU created immediately after the product.\",\n schema: createProductWithSkuSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n createProductWithSkuHandler\n);\n\nserver.tool(\n {\n name: \"vtex_create_brand\",\n description:\n \"Create one brand in VTEX Catalog using the official brand contract. This creates the brand record and returns the created brand payload.\",\n schema: createBrandSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n createBrandHandler\n);\n\nserver.tool(\n {\n name: \"vtex_create_category\",\n description:\n \"Create one category in VTEX Catalog. This writes a new category record and can be used for top-level or child categories depending on fatherCategoryId.\",\n schema: createCategorySchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n createCategoryHandler\n);\n\nserver.tool(\n {\n name: \"vtex_create_specification\",\n description:\n \"Create one specification field in VTEX Catalog, including its field type, group, and visibility flags.\",\n schema: createSpecificationSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n createSpecificationHandler\n);\n\nserver.tool(\n {\n name: \"vtex_create_specification_value\",\n description:\n \"Create one specification value for an existing VTEX specification field.\",\n schema: createSpecificationValueSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n createSpecificationValueHandler\n);\n\nserver.tool(\n {\n name: \"vtex_associate_specification\",\n description:\n \"Associate one specification to one product or one SKU. This writes a single specification association using either a fieldValueId or raw text, depending on the field type.\",\n schema: associateSpecificationSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n associateSpecificationHandler\n);\n\nserver.tool(\n {\n name: \"vtex_attach_catalog_image\",\n description:\n \"Attach one catalog image to one SKU using a public image URL. This adds a new SKU file entry in VTEX Catalog.\",\n schema: attachCatalogImageSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n attachCatalogImageHandler\n);\n\nserver.tool(\n {\n name: \"vtex_cancel_order\",\n description:\n \"Cancel one order in VTEX Orders API. Before using this tool, the assistant must explain what will be canceled, mention that invoiced orders cannot be canceled and cancellations cannot be reversed, and obtain explicit confirmation from the user. Only then should the tool be called with confirmed=true.\",\n schema: cancelOrderSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n cancelOrderHandler\n);\n\nserver.tool(\n {\n name: \"vtex_invoice_order\",\n description:\n \"Invoice one order in VTEX Orders API. Before using this tool, the assistant must explain that invoicing changes the order's logistics and financial state, mention that the tool writes invoice data into VTEX, and obtain explicit confirmation from the user. Only then should the tool be called with confirmed=true.\",\n schema: invoiceOrderSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n invoiceOrderHandler\n);\n\nserver.tool(\n {\n name: \"vtex_add_order_tracking\",\n description:\n \"Add tracking data to one invoiced order in VTEX. Before using this tool, the assistant must explain which invoice and tracking data will be updated, mention that this affects the operational communication sent to the customer, and obtain explicit confirmation from the user. Only then should the tool be called with confirmed=true.\",\n schema: addOrderTrackingSchema,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: true,\n },\n },\n addOrderTrackingHandler\n);\n\nserver.tool(\n {\n name: \"vtex_get_sku_price\",\n description: \"Get base pricing information for one SKU.\",\n schema: skuPriceSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n skuPriceHandler\n);\n\nserver.tool(\n {\n name: \"vtex_get_computed_price\",\n description: \"Get computed SKU price by price table context.\",\n schema: computedPriceSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n computedPriceHandler\n);\n\nserver.tool(\n {\n name: \"vtex_get_product_offers\",\n description: \"Get offers for all SKUs under a product.\",\n schema: productOffersSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n productOffersHandler\n);\n\nserver.tool(\n {\n name: \"vtex_get_sku_offers\",\n description: \"Get offers for a specific SKU under a product.\",\n schema: skuOffersSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n skuOffersHandler\n);\n\nserver.tool(\n {\n name: \"config_check_database_connection\",\n description:\n \"Check whether the MCP can reach its configured database and whether critical tables are present.\",\n schema: checkDatabaseConnectionSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: false,\n },\n },\n checkDatabaseConnectionHandler\n);\n\nserver.tool(\n {\n name: \"config_list_profiles\",\n description: \"List client profiles currently available in the MCP database.\",\n schema: listProfilesSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: false,\n },\n },\n listProfilesHandler\n);\n\nserver.tool(\n {\n name: \"config_get_benchmarks\",\n description:\n \"Devuelve benchmarks de Argentina para c\u00E1lculos financieros: IIBB por provincia, costos de cuotas sin inter\u00E9s (Ahora 12, Plan Z), fees de pasarelas de pago (Mercado Pago, Mobbex, Payway, dLocal), costos log\u00EDsticos por zona y calendario comercial con impacto de revenue.\",\n schema: getBenchmarksSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: false,\n },\n },\n getBenchmarksHandler\n);\n\nserver.tool(\n {\n name: \"gads_get_channel_mix\",\n description:\n \"Get Google Ads mix by advertising channel type for a date range, including spend, clicks, impressions, conversions, conversion value, and channel share.\",\n schema: googleAdsChannelMixSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n googleAdsChannelMixHandler\n);\n\nserver.tool(\n {\n name: \"gads_get_customer_info\",\n description:\n \"Get summary information for one Google Ads customer account, including name, currency, timezone, and whether the account is a manager (MCC).\",\n schema: googleAdsCustomerInfoSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n googleAdsCustomerInfoHandler\n);\n\nserver.tool(\n {\n name: \"gads_list_customer_clients\",\n description:\n \"List visible child accounts for a Google Ads customer account, usually used to inspect manager (MCC) account structure.\",\n schema: googleAdsCustomerClientsSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n googleAdsCustomerClientsHandler\n);\n\nserver.tool(\n {\n name: \"gads_get_account_overview\",\n description:\n \"Get a Google Ads account overview for a date range, including spend, clicks, impressions, conversions, conversion value, CTR, CPC, CPA, and ROAS.\",\n schema: googleAdsAccountOverviewSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n googleAdsAccountOverviewHandler\n);\n\nserver.tool(\n {\n name: \"gads_get_campaign_performance\",\n description:\n \"Get Google Ads campaign-level performance for a date range with spend, clicks, impressions, conversions, conversion value, CTR, CPC, CPA, and ROAS.\",\n schema: googleAdsCampaignPerformanceSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n googleAdsCampaignPerformanceHandler\n);\n\nserver.tool(\n {\n name: \"gads_get_time_series\",\n description:\n \"Get Google Ads daily or weekly time series for a date range with spend, clicks, impressions, conversions, conversion value, CPA, and ROAS.\",\n schema: googleAdsTimeSeriesSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n googleAdsTimeSeriesHandler\n);\n\nserver.tool(\n {\n name: \"gads_get_search_terms_summary\",\n description:\n \"Get a ranked summary of Google Ads search terms for a date range, including spend, clicks, impressions, conversions, conversion value, CPA, and ROAS.\",\n schema: googleAdsSearchTermsSummarySchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n googleAdsSearchTermsSummaryHandler\n);\n\nserver.tool(\n {\n name: \"gads_get_account_risks\",\n description:\n \"Evaluate Google Ads account risks for a date range, including concentration, low efficiency, weak conversion volume, and recent deterioration signals.\",\n schema: googleAdsAccountRisksSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n googleAdsAccountRisksHandler\n);\n\nserver.tool(\n {\n name: \"gads_get_break_even_analysis\",\n description:\n \"Compare current Google Ads performance against a user-provided break-even ROAS and optional CPA target.\",\n schema: googleAdsBreakEvenAnalysisSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n googleAdsBreakEvenAnalysisHandler\n);\n\nserver.tool(\n {\n name: \"gads_get_scaling_health\",\n description:\n \"Assess whether a Google Ads account is ready to scale using break-even ROAS, optional CPA target, concentration, stability, and conversion volume.\",\n schema: googleAdsScalingHealthSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n googleAdsScalingHealthHandler\n);\n\nserver.tool(\n {\n name: \"gads_compare_accounts\",\n description:\n \"Compare multiple Google Ads accounts across the same date range and rank them by basic risk and efficiency signals.\",\n schema: googleAdsCompareAccountsSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n googleAdsCompareAccountsHandler\n);\n\nserver.tool(\n {\n name: \"gsc_list_accessible_sites\",\n description: \"List all Search Console sites accessible with the configured Google credentials.\",\n schema: listAccessibleSitesSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n listAccessibleSitesHandler\n);\n\nserver.tool(\n {\n name: \"gsc_get_site_context\",\n description: \"Validate one Search Console site and return the resolved site context used by the module.\",\n schema: searchConsoleSiteContextSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n searchConsoleSiteContextHandler\n);\n\nserver.tool(\n {\n name: \"gsc_get_search_performance\",\n description: \"Run a flexible Search Console performance query with custom dimensions and filters.\",\n schema: searchConsoleSearchPerformanceSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n searchConsoleSearchPerformanceHandler\n);\n\nserver.tool(\n {\n name: \"gsc_get_query_performance\",\n description: \"Get Search Console performance grouped by search query for a date range.\",\n schema: searchConsoleQueryPerformanceSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n searchConsoleQueryPerformanceHandler\n);\n\nserver.tool(\n {\n name: \"gsc_get_page_performance\",\n description: \"Get Search Console performance grouped by landing page for a date range.\",\n schema: searchConsolePagePerformanceSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n searchConsolePagePerformanceHandler\n);\n\nserver.tool(\n {\n name: \"gsc_get_query_page_matrix\",\n description: \"Get a Search Console matrix crossing queries and landing pages for a date range.\",\n schema: searchConsoleQueryPageMatrixSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n searchConsoleQueryPageMatrixHandler\n);\n\nserver.tool(\n {\n name: \"gsc_get_device_breakdown\",\n description: \"Break down Search Console performance by device for a date range.\",\n schema: searchConsoleDeviceBreakdownSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n searchConsoleDeviceBreakdownHandler\n);\n\nserver.tool(\n {\n name: \"gsc_get_country_breakdown\",\n description: \"Break down Search Console performance by country for a date range.\",\n schema: searchConsoleCountryBreakdownSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n searchConsoleCountryBreakdownHandler\n);\n\nserver.tool(\n {\n name: \"gsc_find_high_impression_low_click_queries\",\n description: \"Find queries with high Search Console impression volume but weak click capture.\",\n schema: searchConsoleHighImpressionLowClickQueriesSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n searchConsoleHighImpressionLowClickQueriesHandler\n);\n\nserver.tool(\n {\n name: \"gsc_find_low_ctr_opportunities\",\n description: \"Find Search Console queries that rank reasonably well but underperform on CTR.\",\n schema: searchConsoleLowCtrOpportunitiesSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n searchConsoleLowCtrOpportunitiesHandler\n);\n\nserver.tool(\n {\n name: \"gsc_detect_visibility_declines\",\n description: \"Detect Search Console pages that are losing visibility between two periods.\",\n schema: searchConsoleVisibilityDeclinesSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n searchConsoleVisibilityDeclinesHandler\n);\n\nserver.tool(\n {\n name: \"gsc_find_product_demand_low_capture_queries\",\n description: \"Find product-intent queries with demand in Search Console but weak click capture.\",\n schema: searchConsoleProductDemandLowCaptureQueriesSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n searchConsoleProductDemandLowCaptureQueriesHandler\n);\n\nserver.tool(\n {\n name: \"gsc_find_rising_non_brand_queries\",\n description: \"Find non-branded Search Console queries growing between two periods.\",\n schema: searchConsoleRisingNonBrandQueriesSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n searchConsoleRisingNonBrandQueriesHandler\n);\n\nserver.tool(\n {\n name: \"gsc_find_quick_win_opportunities\",\n description: \"Prioritize Search Console quick wins across CTR improvements and ranking gains.\",\n schema: searchConsoleQuickWinOpportunitiesSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n searchConsoleQuickWinOpportunitiesHandler\n);\n\nserver.tool(\n {\n name: \"ga4_list_accessible_properties\",\n description: \"List all Google Analytics 4 accounts and properties accessible with the configured OAuth credentials.\",\n schema: listAccessiblePropertiesSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n listAccessiblePropertiesHandler\n);\n\nserver.tool(\n {\n name: \"ga4_get_property_info\",\n description: \"Get summary information and capabilities for one GA4 property, including ecommerce and attribution support.\",\n schema: propertyInfoSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n propertyInfoHandler\n);\n\nserver.tool(\n {\n name: \"ga4_get_channel_mix\",\n description: \"Get traffic mix by default channel group with shares of sessions and users for a date range.\",\n schema: channelMixSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n channelMixHandler\n);\n\nserver.tool(\n {\n name: \"ga4_get_source_medium_breakdown\",\n description: \"Get traffic breakdown by session source / medium with session and user share for a date range.\",\n schema: sourceMediumBreakdownSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n sourceMediumBreakdownHandler\n);\n\nserver.tool(\n {\n name: \"ga4_get_revenue_overview\",\n description: \"Get GA4 ecommerce overview for a date range including transactions, revenue, purchasers, and rates.\",\n schema: revenueOverviewSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n revenueOverviewHandler\n);\n\nserver.tool(\n {\n name: \"ga4_get_revenue_trend\",\n description: \"Get daily GA4 revenue and transactions trend for a date range.\",\n schema: revenueTrendSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n revenueTrendHandler\n);\n\nserver.tool(\n {\n name: \"ga4_get_revenue_by_channel\",\n description: \"Get GA4 revenue and transactions by default channel group for a date range.\",\n schema: revenueByChannelSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n revenueByChannelHandler\n);\n\nserver.tool(\n {\n name: \"ga4_get_top_landing_pages\",\n description: \"Get top landing pages by sessions and users for a date range.\",\n schema: topLandingPagesSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n topLandingPagesHandler\n);\n\nserver.tool(\n {\n name: \"ga4_get_engagement_overview\",\n description: \"Get GA4 engagement metrics for a date range, including engagement rate, bounce rate, and session duration.\",\n schema: engagementOverviewSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n engagementOverviewHandler\n);\n\nserver.tool(\n {\n name: \"ga4_detect_attribution_gaps\",\n description: \"Detect unattributed traffic, unassigned channels, and not-set source / medium values in GA4.\",\n schema: attributionGapsSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n attributionGapsHandler\n);\n\nserver.tool(\n {\n name: \"ga4_check_ecommerce_tracking_health\",\n description: \"Evaluate whether GA4 ecommerce tracking appears complete by checking item views, carts, checkouts, purchases, and refunds.\",\n schema: ecommerceTrackingHealthSchema,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: true,\n },\n },\n ecommerceTrackingHealthHandler\n);\n\nserver.tool(\n {\n name: \"meli_get_account_context\",\n description: \"Get MercadoLibre account context for the selected profile, including seller id, nickname, scopes, and token expiry.\",\n schema: meliGetAccountContextSchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliGetAccountContextHandler\n);\n\nserver.tool(\n {\n name: \"meli_validate_connection\",\n description: \"Validate the MercadoLibre connection for a profile, refreshing tokens if needed and returning the resulting status.\",\n schema: meliValidateConnectionSchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliValidateConnectionHandler\n);\n\nserver.tool(\n {\n name: \"meli_get_orders_summary\",\n description: \"Get MercadoLibre order KPIs or compact order detail chunks for a date range. For reports, summaries, calculations, analysis, KPIs, metrics, performance, revenue, cancellations, refunds, discounts, shipping, trends, flows, or SKU economics, default to responseMode=calculations (calculations-only output, no order rows). Use responseMode=orders_chunk only when the user explicitly needs order-level detail or a question cannot be answered from calculations; it returns up to 15 pages of compact order rows with continuation metadata so the model can fetch more chunks if needed.\",\n schema: meliGetOrdersSummarySchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliGetOrdersSummaryHandler\n);\n\nserver.tool(\n {\n name: \"meli_get_order_details\",\n description: \"Get MercadoLibre order details for one or more order ids with partial-failure handling.\",\n schema: meliGetOrderDetailsSchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliGetOrderDetailsHandler\n);\n\nserver.tool(\n {\n name: \"meli_get_sales_by_item\",\n description: \"Aggregate MercadoLibre sales by item and variation for a date range, split by currency. Returns sales_by_item_schema plus compact positional rows to minimize tokens. The tool fan-outs internally across all order-search pages for the range when possible and returns metadata that makes partial coverage explicit if some pages fail.\",\n schema: meliGetSalesByItemSchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliGetSalesByItemHandler\n);\n\nserver.tool(\n {\n name: \"meli_get_sales_trend\",\n description: \"Build a MercadoLibre sales trend by day or week for a date range, split by currency.\",\n schema: meliGetSalesTrendSchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliGetSalesTrendHandler\n);\n\nserver.tool(\n {\n name: \"meli_get_shipping_summary\",\n description: \"Build a MercadoLibre shipping report for a date range. Default responseMode=calculations returns aggregate delivery health, logistics mix, cost, and daily trend KPIs; responseMode=shipments_chunk returns compact shipment rows with continuation metadata.\",\n schema: meliGetShippingSummarySchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliGetShippingSummaryHandler\n);\n\nserver.tool(\n {\n name: \"meli_get_item_visits\",\n description: \"Get MercadoLibre visits totals for seller-level date ranges or item-level time windows.\",\n schema: meliGetItemVisitsSchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliGetItemVisitsHandler\n);\n\nserver.tool(\n {\n name: \"meli_get_store_performance\",\n description: \"Combine MercadoLibre orders, items, and visits into an executive store performance summary.\",\n schema: meliGetStorePerformanceSchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliGetStorePerformanceHandler\n);\n\nserver.tool(\n {\n name: \"meli_search_items\",\n description: \"Search MercadoLibre seller items with compact detailed rows. Defaults to status=active, supports title text search, and returns items_schema plus compact item rows instead of raw item ids.\",\n schema: meliSearchItemsSchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliSearchItemsHandler\n);\n\nserver.tool(\n {\n name: \"meli_get_item_details\",\n description: \"Get rich MercadoLibre item details for one or more item ids with multiget and fallback batch handling. Returns near-raw listing context including attributes, sale terms, shipping, seller/location, dates, tags, and status, excluding pictures.\",\n schema: meliGetItemDetailsSchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliGetItemDetailsHandler\n);\n\nserver.tool(\n {\n name: \"meli_get_listing_quality\",\n description: \"Get listing quality and performance signals for a MercadoLibre item.\",\n schema: meliGetListingQualitySchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliGetListingQualityHandler\n);\n\nserver.tool(\n {\n name: \"meli_predict_category\",\n description: \"Predict candidate MercadoLibre categories and domains from a product query.\",\n schema: meliPredictCategorySchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliPredictCategoryHandler\n);\n\nserver.tool(\n {\n name: \"meli_get_category_requirements\",\n description: \"Get MercadoLibre category attribute requirements and shipping preferences for a category.\",\n schema: meliGetCategoryRequirementsSchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliGetCategoryRequirementsHandler\n);\n\nserver.tool(\n {\n name: \"meli_get_site_categories_and_listing_types\",\n description: \"Get MercadoLibre Argentina site categories and available listing types in a single catalog response.\",\n schema: meliGetSiteCategoriesAndListingTypesSchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliGetSiteCategoriesAndListingTypesHandler\n);\n\nserver.tool(\n {\n name: \"meli_estimate_listing_fee\",\n description: \"Estimate MercadoLibre selling fees with guided precision. Accepts an itemId to autocomplete listing parameters or manual price/category/listing/logistics/weight inputs, and returns missing params when precision can improve.\",\n schema: meliEstimateListingFeeSchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliEstimateListingFeeHandler\n);\n\nserver.tool(\n {\n name: \"meli_estimate_product_profitability\",\n description: \"Estimate whether a MercadoLibre product is profitable, using precise fee quotes, historical order/shipping data, and optional Billing ML audit. If user costs are missing, returns break-even limits and guided questions instead of failing.\",\n schema: meliEstimateProductProfitabilitySchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliEstimateProductProfitabilityHandler\n);\n\nserver.tool(\n {\n name: \"meli_create_item\",\n description: \"Create a MercadoLibre item directly for the selected profile, optionally publishing its description too.\",\n schema: meliCreateItemSchema,\n annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true },\n },\n meliCreateItemHandler\n);\n\nserver.tool(\n {\n name: \"meli_update_item_basic_fields\",\n description: \"Update MercadoLibre item fields such as title, price, quantity, attributes, shipping, and status.\",\n schema: meliUpdateItemBasicFieldsSchema,\n annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: true },\n },\n meliUpdateItemBasicFieldsHandler\n);\n\nserver.tool(\n {\n name: \"meli_update_item_description\",\n description: \"Create or replace the published MercadoLibre plain-text item description.\",\n schema: meliUpdateItemDescriptionSchema,\n annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: true },\n },\n meliUpdateItemDescriptionHandler\n);\n\nserver.tool(\n {\n name: \"meli_update_item_pictures\",\n description: \"Add or replace MercadoLibre item pictures using public image URLs.\",\n schema: meliUpdateItemPicturesSchema,\n annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: true },\n },\n meliUpdateItemPicturesHandler\n);\n\nserver.tool(\n {\n name: \"meli_pause_or_reactivate_item\",\n description: \"Pause or reactivate a MercadoLibre item by changing its listing status.\",\n schema: meliPauseOrReactivateItemSchema,\n annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: true },\n },\n meliPauseOrReactivateItemHandler\n);\n\nserver.tool(\n {\n name: \"meli_search_questions\",\n description: \"Search MercadoLibre buyer questions for the selected seller with compact pagination-aware output.\",\n schema: meliSearchQuestionsSchema,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },\n },\n meliSearchQuestionsHandler\n);\n\nserver.tool(\n {\n name: \"meli_answer_question\",\n description: \"Publish a MercadoLibre answer for a specific buyer question.\",\n schema: meliAnswerQuestionSchema,\n annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true },\n },\n meliAnswerQuestionHandler\n);\n\nserver.prompt(\n {\n name: \"vtex-reporte-ventas\",\n description:\n \"Genera un prompt de reporte de ventas VTEX usando una sola entrada temporal en lenguaje natural.\",\n schema: reporteVentasPromptSchema,\n },\n reporteVentasPromptHandler\n);\n\nasync function createStdioTransportFromMcpUseDependency() {\n const requireFromHere = createRequire(import.meta.url);\n const mcpUseServerEntry = requireFromHere.resolve(\"mcp-use/server\");\n const requireFromMcpUse = createRequire(mcpUseServerEntry);\n const stdioModulePath = requireFromMcpUse.resolve(\"@modelcontextprotocol/sdk/server/stdio.js\");\n const stdioModule = (await import(pathToFileURL(stdioModulePath).href)) as {\n StdioServerTransport: new () => unknown;\n };\n\n return new stdioModule.StdioServerTransport();\n}\n\nasync function startServer() {\n const transport = (process.env.MCP_TRANSPORT ?? \"http\").trim().toLowerCase();\n\n if (transport === \"stdio\") {\n const stdioTransport = await createStdioTransportFromMcpUseDependency();\n await server.nativeServer.connect(stdioTransport as any);\n console.error(\"MCP server running on stdio transport\");\n return;\n }\n\n if (transport === \"http\") {\n const port = process.env.PORT ? Number.parseInt(process.env.PORT, 10) : 3000;\n if (Number.isNaN(port)) {\n throw new Error(`Invalid PORT value: ${process.env.PORT}`);\n }\n\n console.error(`MCP server running on http transport (port ${port})`);\n await server.listen(port);\n return;\n }\n\n throw new Error(`Invalid MCP_TRANSPORT \"${process.env.MCP_TRANSPORT}\". Use \"http\" or \"stdio\".`);\n}\n\nstartServer().catch((error) => {\n console.error(\"Failed to start MCP server\", error);\n process.exit(1);\n});\n"],
5
+ "mappings": "AAAA,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,iBAAiB;AAE1B;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB,2BAA2B;AAC1D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAA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AiB,MAAM,yCAAyC;AACtE,UAAM,OAAO,aAAa,QAAQ,cAAqB;AACvD,YAAQ,MAAM,uCAAuC;AACrD;AAAA,EACF;AAEA,MAAI,cAAc,QAAQ;AACxB,UAAM,OAAO,QAAQ,IAAI,OAAO,OAAO,SAAS,QAAQ,IAAI,MAAM,EAAE,IAAI;AACxE,QAAI,OAAO,MAAM,IAAI,GAAG;AACtB,YAAM,IAAI,MAAM,uBAAuB,QAAQ,IAAI,IAAI,EAAE;AAAA,IAC3D;AAEA,YAAQ,MAAM,8CAA8C,IAAI,GAAG;AACnE,UAAM,OAAO,OAAO,IAAI;AACxB;AAAA,EACF;AAEA,QAAM,IAAI,MAAM,0BAA0B,QAAQ,IAAI,aAAa,2BAA2B;AAChG;AAEA,YAAY,EAAE,MAAM,CAAC,UAAU;AAC7B,UAAQ,MAAM,8BAA8B,KAAK;AACjD,UAAQ,KAAK,CAAC;AAChB,CAAC;",
6
6
  "names": []
7
7
  }
package/dist/mcp-use.json CHANGED
@@ -1,7 +1,10 @@
1
1
  {
2
2
  "includeInspector": false,
3
- "buildTime": "2026-05-09T13:51:11.060Z",
4
- "buildId": "36c5bf69e0616c4e",
3
+ "buildTime": "2026-05-14T20:47:30.369Z",
4
+ "buildId": "ed22d4fb3aa472a7",
5
5
  "entryPoint": "dist/index.js",
6
- "widgets": {}
6
+ "widgets": {},
7
+ "tunnel": {
8
+ "subdomain": "historic-amethyst"
9
+ }
7
10
  }
@@ -0,0 +1,77 @@
1
+ import { getMercadoLibreApiContext, formatMercadoLibreError } from "./mercadolibre-api.js";
2
+ async function getMercadoLibreBillingDetailsPage(profileId, params) {
3
+ const { api } = await getMercadoLibreApiContext(profileId);
4
+ const documentType = params.documentType ?? "BILL";
5
+ const group = params.group ?? "ML";
6
+ const limit = Math.min(150, Math.max(1, Math.floor(params.limit ?? 150)));
7
+ const offset = Math.max(0, Math.floor(params.offset ?? 0));
8
+ const response = await api.get(
9
+ `/billing/integration/periods/key/${params.periodKey}/group/${group}/details`,
10
+ {
11
+ params: {
12
+ document_type: documentType,
13
+ limit,
14
+ offset
15
+ }
16
+ }
17
+ );
18
+ return {
19
+ offset: Number(response.data.offset ?? offset),
20
+ limit: Number(response.data.limit ?? limit),
21
+ total: Number(response.data.total ?? 0),
22
+ results: Array.isArray(response.data.results) ? response.data.results : []
23
+ };
24
+ }
25
+ async function getMercadoLibreBillingDetails(profileId, params) {
26
+ const limit = Math.min(150, Math.max(1, Math.floor(params.limit ?? 150)));
27
+ const maxPages = Math.max(1, Math.floor(params.maxPages ?? 20));
28
+ const documentType = params.documentType ?? "BILL";
29
+ const group = params.group ?? "ML";
30
+ const rows = [];
31
+ const failures = [];
32
+ let totalReported = 0;
33
+ let pagesRequested = 0;
34
+ let pagesSucceeded = 0;
35
+ for (let pageIndex = 0; pageIndex < maxPages; pageIndex += 1) {
36
+ const offset = pageIndex * limit;
37
+ pagesRequested += 1;
38
+ try {
39
+ const page = await getMercadoLibreBillingDetailsPage(profileId, {
40
+ ...params,
41
+ group,
42
+ documentType,
43
+ limit,
44
+ offset
45
+ });
46
+ pagesSucceeded += 1;
47
+ totalReported = Math.max(totalReported, page.total);
48
+ rows.push(...page.results);
49
+ if (offset + page.results.length >= page.total || page.results.length === 0) {
50
+ break;
51
+ }
52
+ } catch (error) {
53
+ failures.push({
54
+ offset,
55
+ limit,
56
+ message: formatMercadoLibreError(error, "Failed to fetch MercadoLibre billing details")
57
+ });
58
+ break;
59
+ }
60
+ }
61
+ return {
62
+ period_key: params.periodKey,
63
+ group,
64
+ document_type: documentType,
65
+ pages_requested: pagesRequested,
66
+ pages_succeeded: pagesSucceeded,
67
+ pages_failed: failures.length,
68
+ total_reported: totalReported,
69
+ rows,
70
+ failures
71
+ };
72
+ }
73
+ export {
74
+ getMercadoLibreBillingDetails,
75
+ getMercadoLibreBillingDetailsPage
76
+ };
77
+ //# sourceMappingURL=mercadolibre-billing.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/services/mercadolibre/mercadolibre-billing.ts"],
4
+ "sourcesContent": ["import { getMercadoLibreApiContext, formatMercadoLibreError } from \"./mercadolibre-api.js\";\n\nexport interface MercadoLibreBillingDetailsParams {\n periodKey: string;\n documentType?: \"BILL\" | \"CREDIT_NOTE\";\n group?: \"ML\" | \"MP\" | \"flex\";\n limit?: number;\n offset?: number;\n}\n\nexport interface MercadoLibreBillingPage {\n offset: number;\n limit: number;\n total: number;\n results: Record<string, unknown>[];\n}\n\nexport interface MercadoLibreBillingFetchResult {\n period_key: string;\n group: string;\n document_type: string;\n pages_requested: number;\n pages_succeeded: number;\n pages_failed: number;\n total_reported: number;\n rows: Record<string, unknown>[];\n failures: Array<{\n offset: number;\n limit: number;\n message: string;\n }>;\n}\n\nexport async function getMercadoLibreBillingDetailsPage(\n profileId: string,\n params: MercadoLibreBillingDetailsParams\n): Promise<MercadoLibreBillingPage> {\n const { api } = await getMercadoLibreApiContext(profileId);\n const documentType = params.documentType ?? \"BILL\";\n const group = params.group ?? \"ML\";\n const limit = Math.min(150, Math.max(1, Math.floor(params.limit ?? 150)));\n const offset = Math.max(0, Math.floor(params.offset ?? 0));\n\n const response = await api.get<Record<string, unknown>>(\n `/billing/integration/periods/key/${params.periodKey}/group/${group}/details`,\n {\n params: {\n document_type: documentType,\n limit,\n offset,\n },\n }\n );\n\n return {\n offset: Number(response.data.offset ?? offset),\n limit: Number(response.data.limit ?? limit),\n total: Number(response.data.total ?? 0),\n results: Array.isArray(response.data.results)\n ? (response.data.results as Record<string, unknown>[])\n : [],\n };\n}\n\nexport async function getMercadoLibreBillingDetails(\n profileId: string,\n params: Omit<MercadoLibreBillingDetailsParams, \"offset\"> & { maxPages?: number }\n): Promise<MercadoLibreBillingFetchResult> {\n const limit = Math.min(150, Math.max(1, Math.floor(params.limit ?? 150)));\n const maxPages = Math.max(1, Math.floor(params.maxPages ?? 20));\n const documentType = params.documentType ?? \"BILL\";\n const group = params.group ?? \"ML\";\n const rows: Record<string, unknown>[] = [];\n const failures: MercadoLibreBillingFetchResult[\"failures\"] = [];\n\n let totalReported = 0;\n let pagesRequested = 0;\n let pagesSucceeded = 0;\n\n for (let pageIndex = 0; pageIndex < maxPages; pageIndex += 1) {\n const offset = pageIndex * limit;\n pagesRequested += 1;\n\n try {\n const page = await getMercadoLibreBillingDetailsPage(profileId, {\n ...params,\n group,\n documentType,\n limit,\n offset,\n });\n pagesSucceeded += 1;\n totalReported = Math.max(totalReported, page.total);\n rows.push(...page.results);\n\n if (offset + page.results.length >= page.total || page.results.length === 0) {\n break;\n }\n } catch (error) {\n failures.push({\n offset,\n limit,\n message: formatMercadoLibreError(error, \"Failed to fetch MercadoLibre billing details\"),\n });\n break;\n }\n }\n\n return {\n period_key: params.periodKey,\n group,\n document_type: documentType,\n pages_requested: pagesRequested,\n pages_succeeded: pagesSucceeded,\n pages_failed: failures.length,\n total_reported: totalReported,\n rows,\n failures,\n };\n}\n"],
5
+ "mappings": "AAAA,SAAS,2BAA2B,+BAA+B;AAiCnE,eAAsB,kCACpB,WACA,QACkC;AAClC,QAAM,EAAE,IAAI,IAAI,MAAM,0BAA0B,SAAS;AACzD,QAAM,eAAe,OAAO,gBAAgB;AAC5C,QAAM,QAAQ,OAAO,SAAS;AAC9B,QAAM,QAAQ,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,KAAK,MAAM,OAAO,SAAS,GAAG,CAAC,CAAC;AACxE,QAAM,SAAS,KAAK,IAAI,GAAG,KAAK,MAAM,OAAO,UAAU,CAAC,CAAC;AAEzD,QAAM,WAAW,MAAM,IAAI;AAAA,IACzB,oCAAoC,OAAO,SAAS,UAAU,KAAK;AAAA,IACnE;AAAA,MACE,QAAQ;AAAA,QACN,eAAe;AAAA,QACf;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AAAA,IACL,QAAQ,OAAO,SAAS,KAAK,UAAU,MAAM;AAAA,IAC7C,OAAO,OAAO,SAAS,KAAK,SAAS,KAAK;AAAA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AAAA,IACA;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -3,13 +3,13 @@ import {
3
3
  parseMercadoLibreMultiget,
4
4
  runMercadoLibreBatch
5
5
  } from "./mercadolibre-api.js";
6
- async function searchMercadoLibreItems(profileId, params) {
7
- const { api } = await getMercadoLibreApiContext(profileId);
6
+ async function fetchItemsSearchPage(api, params) {
8
7
  const response = await api.get(
9
8
  `/users/${params.sellerId}/items/search`,
10
9
  {
11
10
  params: {
12
11
  status: params.status,
12
+ q: params.q,
13
13
  category: params.category,
14
14
  listing_type_id: params.listingTypeId,
15
15
  orders: params.orders,
@@ -20,6 +20,19 @@ async function searchMercadoLibreItems(profileId, params) {
20
20
  );
21
21
  return response.data;
22
22
  }
23
+ async function searchMercadoLibreItems(profileId, params) {
24
+ const { api } = await getMercadoLibreApiContext(profileId);
25
+ return fetchItemsSearchPage(api, params);
26
+ }
27
+ async function searchMercadoLibreItemsBatch(profileId, params, offsets, options = {}) {
28
+ const { api } = await getMercadoLibreApiContext(profileId);
29
+ const offsetIds = offsets.map((offset) => String(offset));
30
+ return runMercadoLibreBatch(
31
+ offsetIds,
32
+ (offsetId) => fetchItemsSearchPage(api, { ...params, offset: Number(offsetId) }),
33
+ options
34
+ );
35
+ }
23
36
  async function getMercadoLibreItem(profileId, itemId) {
24
37
  const { api } = await getMercadoLibreApiContext(profileId);
25
38
  const response = await api.get(`/items/${itemId}`);
@@ -134,6 +147,18 @@ async function getMercadoLibreItemPerformance(profileId, itemId) {
134
147
  const response = await api.get(`/item/${itemId}/performance`);
135
148
  return response.data;
136
149
  }
150
+ async function getMercadoLibreSiteCategoriesAndListingTypes(profileId, siteId = "MLA") {
151
+ const { api } = await getMercadoLibreApiContext(profileId);
152
+ const [categoriesResponse, listingTypesResponse] = await Promise.all([
153
+ api.get(`/sites/${siteId}/categories`),
154
+ api.get(`/sites/${siteId}/listing_types`)
155
+ ]);
156
+ return {
157
+ siteId,
158
+ categories: categoriesResponse.data,
159
+ listingTypes: listingTypesResponse.data
160
+ };
161
+ }
137
162
  export {
138
163
  addMercadoLibreItemPicture,
139
164
  createMercadoLibreItem,
@@ -147,10 +172,12 @@ export {
147
172
  getMercadoLibreItemDetailsWithFallbackBatch,
148
173
  getMercadoLibreItemPerformance,
149
174
  getMercadoLibreItemVisitsWindow,
175
+ getMercadoLibreSiteCategoriesAndListingTypes,
150
176
  getMercadoLibreUserItemsVisits,
151
177
  replaceMercadoLibreItemDescription,
152
178
  searchMercadoLibreDomainDiscovery,
153
179
  searchMercadoLibreItems,
180
+ searchMercadoLibreItemsBatch,
154
181
  updateMercadoLibreItem
155
182
  };
156
183
  //# sourceMappingURL=mercadolibre-items.js.map