portkey-admin-mcp 0.3.0 → 0.3.1

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 (3) hide show
  1. package/build/index.js +150 -169
  2. package/build/server.js +150 -169
  3. package/package.json +1 -1
package/build/index.js CHANGED
@@ -1866,7 +1866,7 @@ function normalizeAnalyticsParams(params) {
1866
1866
  function registerAnalyticsTools(server, service) {
1867
1867
  server.tool(
1868
1868
  "get_cost_analytics",
1869
- "Returns time-series of total and average cost per request over the specified period. Use to track spending trends and identify cost spikes. Differs from get_token_analytics which measures token consumption, not monetary cost. Requires time_of_generation_min and time_of_generation_max.",
1869
+ "Get cost time-series data with summary.total_cost, summary.average_cost_per_request, and per-bucket total/avg cost. Use this for spend analysis and spike detection; use get_token_analytics when you need token volume instead of monetary cost.",
1870
1870
  baseAnalyticsSchema,
1871
1871
  async (params) => {
1872
1872
  const analytics = await service.analytics.getCostAnalytics(
@@ -1899,7 +1899,7 @@ function registerAnalyticsTools(server, service) {
1899
1899
  );
1900
1900
  server.tool(
1901
1901
  "get_request_analytics",
1902
- "Returns time-series of total, successful, and failed request counts over the specified period. Use to monitor traffic volume and success/failure trends. Differs from get_error_analytics which only shows error counts. Requires time_of_generation_min and time_of_generation_max.",
1902
+ "Get request-volume time-series data with summary.total_requests, summary.successful_requests, summary.failed_requests, and per-bucket total/success/failed counts. Use this for traffic and reliability trends; use get_error_analytics when you only need error counts.",
1903
1903
  requestAnalyticsSchema,
1904
1904
  async (params) => {
1905
1905
  const analytics = await service.analytics.getRequestAnalytics(
@@ -1934,7 +1934,7 @@ function registerAnalyticsTools(server, service) {
1934
1934
  );
1935
1935
  server.tool(
1936
1936
  "get_token_analytics",
1937
- "Returns time-series of total, prompt, and completion token counts over the specified period. Use to track token consumption and identify usage patterns. Differs from get_cost_analytics which shows monetary cost, not token volume. Requires time_of_generation_min and time_of_generation_max.",
1937
+ "Get token-usage time-series data with summary.total_tokens, summary.prompt_tokens, summary.completion_tokens, and per-bucket total/prompt/completion counts. Use this for consumption trends; use get_cost_analytics when you need spend instead of token volume.",
1938
1938
  baseAnalyticsSchema,
1939
1939
  async (params) => {
1940
1940
  const analytics = await service.analytics.getTokenAnalytics(
@@ -1969,7 +1969,7 @@ function registerAnalyticsTools(server, service) {
1969
1969
  );
1970
1970
  server.tool(
1971
1971
  "get_latency_analytics",
1972
- "Returns time-series of avg, p50, p90, and p99 latency percentiles in ms over the specified period. Use to monitor response times and detect latency regressions. Differs from get_cache_hit_latency which only measures latency for cached responses. Requires time_of_generation_min and time_of_generation_max.",
1972
+ "Get latency time-series data with summary.avg_latency_ms, summary.p50_latency_ms, summary.p90_latency_ms, summary.p99_latency_ms, and per-bucket latency percentiles in ms. Use this to spot slowdowns and regressions; use get_cache_hit_latency when you only want cache-hit latency.",
1973
1973
  baseAnalyticsSchema,
1974
1974
  async (params) => {
1975
1975
  const analytics = await service.analytics.getLatencyAnalytics(
@@ -2006,7 +2006,7 @@ function registerAnalyticsTools(server, service) {
2006
2006
  );
2007
2007
  server.tool(
2008
2008
  "get_error_analytics",
2009
- "Returns time-series of total error counts over the specified period. Use for high-level error trend monitoring. For error breakdown by status code, use get_error_status_codes_analytics or get_error_stacks_analytics; for error rate as a percentage, use get_error_rate_analytics. Requires time_of_generation_min and time_of_generation_max.",
2009
+ "Get error-count time-series data with summary.total_errors and per-bucket counts. Use this for high-level error trends; use get_error_rate_analytics for percentages, or get_error_status_codes_analytics and get_error_stacks_analytics for breakdowns.",
2010
2010
  baseAnalyticsSchema,
2011
2011
  async (params) => {
2012
2012
  const analytics = await service.analytics.getErrorAnalytics(
@@ -2037,7 +2037,7 @@ function registerAnalyticsTools(server, service) {
2037
2037
  );
2038
2038
  server.tool(
2039
2039
  "get_error_rate_analytics",
2040
- "Returns time-series of error rate as a percentage of total requests over the specified period. Use to track reliability trends and SLA compliance. Differs from get_error_analytics which shows absolute error counts, not percentages. Requires time_of_generation_min and time_of_generation_max.",
2040
+ "Get error-rate time-series data with summary.error_rate_percent and per-bucket percentages of total requests. Use this for reliability and SLA trends; use get_error_analytics for absolute error counts instead.",
2041
2041
  baseAnalyticsSchema,
2042
2042
  async (params) => {
2043
2043
  const analytics = await service.analytics.getErrorRateAnalytics(
@@ -2068,7 +2068,7 @@ function registerAnalyticsTools(server, service) {
2068
2068
  );
2069
2069
  server.tool(
2070
2070
  "get_cache_hit_latency",
2071
- "Returns time-series of latency specifically for cache hits over the specified period. Use to evaluate cache performance and response speed for cached requests. Differs from get_latency_analytics which measures latency across all requests. Requires time_of_generation_min and time_of_generation_max.",
2071
+ "Get cache-hit-only latency time-series data with summary.total_latency, summary.avg_latency, and per-bucket total/avg latency. Use this to evaluate cached-response speed; use get_latency_analytics for all requests.",
2072
2072
  baseAnalyticsSchema,
2073
2073
  async (params) => {
2074
2074
  const analytics = await service.analytics.getCacheHitLatency(
@@ -2101,7 +2101,7 @@ function registerAnalyticsTools(server, service) {
2101
2101
  );
2102
2102
  server.tool(
2103
2103
  "get_cache_hit_rate",
2104
- "Returns time-series of cache hit rate percentage, total hits, and misses over the specified period. Use to evaluate cache effectiveness and tune caching strategy. Unrelated to get_cache_hit_latency which measures speed of cached responses, not hit/miss ratio. Requires time_of_generation_min and time_of_generation_max.",
2104
+ "Get cache-effectiveness time-series data with summary.hit_rate, summary.total_hits, summary.total_misses, and per-bucket hits/misses/rate. Use this to measure cache effectiveness; use get_cache_hit_latency for speed rather than hit/miss ratio.",
2105
2105
  baseAnalyticsSchema,
2106
2106
  async (params) => {
2107
2107
  const analytics = await service.analytics.getCacheHitRate(
@@ -2136,7 +2136,7 @@ function registerAnalyticsTools(server, service) {
2136
2136
  );
2137
2137
  server.tool(
2138
2138
  "get_users_analytics",
2139
- "Returns time-series of active and new user counts over the specified period. Use for user growth tracking and adoption metrics. Differs from get_user_requests_analytics which shows per-user request breakdown, and get_analytics_group_users which shows per-user cost/token data. Requires time_of_generation_min and time_of_generation_max.",
2139
+ "Get user-growth time-series data with summary.total_active_users, summary.total_new_users, and per-bucket active/new user counts. Use this for growth and adoption trends; use get_user_requests_analytics for per-user traffic or get_analytics_group_users for per-user cost and token detail.",
2140
2140
  baseAnalyticsSchema,
2141
2141
  async (params) => {
2142
2142
  const analytics = await service.analytics.getUsersAnalytics(
@@ -2169,7 +2169,7 @@ function registerAnalyticsTools(server, service) {
2169
2169
  );
2170
2170
  server.tool(
2171
2171
  "get_error_stacks_analytics",
2172
- "Returns errors broken down by status code stacks (e.g., 429, 500, 502) over the specified period. Use to identify which error types are most common and how they trend. Differs from get_error_status_codes_analytics which shows unique code distribution rather than stacked/cumulative breakdown. Requires time_of_generation_min and time_of_generation_max.",
2172
+ "Get stacked error-series data grouped by HTTP status code over time, with summary and per-code series. Use this to see which error classes dominate; use get_error_status_codes_analytics for distinct-code distribution instead.",
2173
2173
  baseAnalyticsSchema,
2174
2174
  async (params) => {
2175
2175
  const analytics = await service.analytics.getErrorStacksAnalytics(
@@ -2191,7 +2191,7 @@ function registerAnalyticsTools(server, service) {
2191
2191
  );
2192
2192
  server.tool(
2193
2193
  "get_error_status_codes_analytics",
2194
- "Returns distribution of unique HTTP error status codes over the specified period. Use to see which status codes are occurring and their frequency. Differs from get_error_stacks_analytics which shows stacked/cumulative error breakdown rather than individual code distribution. Requires time_of_generation_min and time_of_generation_max.",
2194
+ "Get HTTP error-code distribution time-series data with summary and per-code series. Use this to see which codes occur most often; use get_error_stacks_analytics for stacked or cumulative breakdowns.",
2195
2195
  baseAnalyticsSchema,
2196
2196
  async (params) => {
2197
2197
  const analytics = await service.analytics.getErrorStatusCodesAnalytics(
@@ -2213,7 +2213,7 @@ function registerAnalyticsTools(server, service) {
2213
2213
  );
2214
2214
  server.tool(
2215
2215
  "get_user_requests_analytics",
2216
- "Returns per-user request count breakdown over the specified period. Use to identify heavy users and per-user traffic patterns. Differs from get_users_analytics which shows aggregate active/new user counts, not individual user breakdowns. Requires time_of_generation_min and time_of_generation_max.",
2216
+ "Get per-user request-count time-series data with counts grouped by user. Use this to find heavy users and traffic concentration; use get_users_analytics for aggregate active and new user trends instead.",
2217
2217
  baseAnalyticsSchema,
2218
2218
  async (params) => {
2219
2219
  const analytics = await service.analytics.getUserRequestsAnalytics(
@@ -2235,7 +2235,7 @@ function registerAnalyticsTools(server, service) {
2235
2235
  );
2236
2236
  server.tool(
2237
2237
  "get_rescued_requests_analytics",
2238
- "Returns time-series of requests saved by retry or fallback strategies over the specified period. Use to evaluate the effectiveness of your Portkey configs' resilience features. Only relevant if configs include retry or fallback targets. Requires time_of_generation_min and time_of_generation_max.",
2238
+ "Get rescued-request time-series data showing requests recovered by retry or fallback handling. Use this only when your configs include resilience features, and use it to measure how often recovery logic saved requests.",
2239
2239
  baseAnalyticsSchema,
2240
2240
  async (params) => {
2241
2241
  const analytics = await service.analytics.getRescuedRequestsAnalytics(
@@ -2257,7 +2257,7 @@ function registerAnalyticsTools(server, service) {
2257
2257
  );
2258
2258
  server.tool(
2259
2259
  "get_feedback_analytics",
2260
- "Returns time-series of feedback submission counts over the specified period. Use to track feedback volume trends. For breakdown by model, use get_feedback_models_analytics; for score distribution, use get_feedback_scores_analytics; for weighted scores, use get_feedback_weighted_analytics. Requires time_of_generation_min and time_of_generation_max.",
2260
+ "Get feedback-submission time-series data with summary totals and per-bucket counts. Use this as the top-level feedback trend view; use get_feedback_models_analytics, get_feedback_scores_analytics, or get_feedback_weighted_analytics for breakdowns.",
2261
2261
  baseAnalyticsSchema,
2262
2262
  async (params) => {
2263
2263
  const analytics = await service.analytics.getFeedbackAnalytics(
@@ -2279,7 +2279,7 @@ function registerAnalyticsTools(server, service) {
2279
2279
  );
2280
2280
  server.tool(
2281
2281
  "get_feedback_models_analytics",
2282
- "Returns feedback counts grouped by AI model over the specified period. Use to compare user satisfaction and feedback volume across different models. Differs from get_feedback_analytics which shows total volume without model breakdown. Requires time_of_generation_min and time_of_generation_max.",
2282
+ "Get feedback time-series data grouped by model, with per-model counts over time. Use this to compare feedback volume and satisfaction across models; use get_feedback_analytics for the overall total instead.",
2283
2283
  baseAnalyticsSchema,
2284
2284
  async (params) => {
2285
2285
  const analytics = await service.analytics.getFeedbackModelsAnalytics(
@@ -2301,7 +2301,7 @@ function registerAnalyticsTools(server, service) {
2301
2301
  );
2302
2302
  server.tool(
2303
2303
  "get_feedback_scores_analytics",
2304
- "Returns distribution of raw feedback score values over the specified period. Use to understand score patterns (e.g., mostly positive vs mixed). Differs from get_feedback_weighted_analytics which applies weight factors for calibrated metrics. Requires time_of_generation_min and time_of_generation_max.",
2304
+ "Get raw feedback-score distribution time-series data with per-score buckets. Use this to understand sentiment mix; use get_feedback_weighted_analytics for calibrated scores with weighting.",
2305
2305
  baseAnalyticsSchema,
2306
2306
  async (params) => {
2307
2307
  const analytics = await service.analytics.getFeedbackScoresAnalytics(
@@ -2323,7 +2323,7 @@ function registerAnalyticsTools(server, service) {
2323
2323
  );
2324
2324
  server.tool(
2325
2325
  "get_feedback_weighted_analytics",
2326
- "Returns weighted feedback scores over the specified period, applying the weight factor set during feedback creation. Use for calibrated quality metrics where different feedback types have different importance. Differs from get_feedback_scores_analytics which shows raw unweighted scores. Requires time_of_generation_min and time_of_generation_max.",
2326
+ "Get weighted feedback-score time-series data using the weight recorded at feedback creation. Use this for calibrated quality metrics; use get_feedback_scores_analytics for the raw unweighted distribution.",
2327
2327
  baseAnalyticsSchema,
2328
2328
  async (params) => {
2329
2329
  const analytics = await service.analytics.getFeedbackWeightedAnalytics(
@@ -2345,7 +2345,7 @@ function registerAnalyticsTools(server, service) {
2345
2345
  );
2346
2346
  server.tool(
2347
2347
  "get_analytics_group_users",
2348
- "Returns analytics data aggregated per user with pagination, showing each user's request count, cost, and token usage. Use for per-user billing, audit, or identifying top consumers. Differs from get_users_analytics which shows aggregate active/new user counts over time. Requires time_of_generation_min and time_of_generation_max.",
2348
+ "Get a paginated per-user breakdown with total_groups, group_count, and a users array containing request count, cost, and token usage. Use this for billing, audits, or top-consumer analysis; use get_users_analytics for aggregate active and new user trends.",
2349
2349
  paginatedAnalyticsSchema,
2350
2350
  async (params) => {
2351
2351
  const analytics = await service.analytics.getAnalyticsGroupUsers(
@@ -2367,7 +2367,7 @@ function registerAnalyticsTools(server, service) {
2367
2367
  );
2368
2368
  server.tool(
2369
2369
  "get_analytics_group_models",
2370
- "Returns analytics data aggregated per AI model with pagination, showing each model's request count, cost, and token usage. Use to compare model costs, popularity, and efficiency. Requires time_of_generation_min and time_of_generation_max.",
2370
+ "Get a paginated per-model breakdown with total_groups, group_count, and a models array containing request count, cost, and token usage. Use this to compare model cost, popularity, and efficiency; use get_token_analytics or get_cost_analytics for time-series trends instead.",
2371
2371
  paginatedAnalyticsSchema,
2372
2372
  async (params) => {
2373
2373
  const analytics = await service.analytics.getAnalyticsGroupModels(
@@ -2389,7 +2389,7 @@ function registerAnalyticsTools(server, service) {
2389
2389
  );
2390
2390
  server.tool(
2391
2391
  "get_analytics_group_metadata",
2392
- "Returns analytics data grouped by a custom metadata key (e.g., 'env', 'app', 'client_id') with pagination. Use for custom breakdowns like per-environment or per-feature cost analysis. Requires the metadata_key parameter in addition to time_of_generation_min and time_of_generation_max.",
2392
+ "Get a paginated metadata breakdown with total_groups, group_count, and a metadata_groups array grouped by the required metadata_key. Use this for custom breakdowns like per-environment or per-feature analysis; pass metadata_key in addition to the time window.",
2393
2393
  analyticsGroupMetadataSchema,
2394
2394
  async (params) => {
2395
2395
  const { metadata_key, ...analyticsParams } = params;
@@ -2439,7 +2439,7 @@ var AUDIT_TOOL_SCHEMAS = {
2439
2439
  function registerAuditTools(server, service) {
2440
2440
  server.tool(
2441
2441
  "list_audit_logs",
2442
- "Retrieve audit logs for your Portkey organization. Use this for compliance and security reviews. Audit logs track all administrative actions including user management, configuration changes, and access events. Unlike analytics tools which show aggregated metrics, audit logs show individual action events with actor details. Supports filtering by time range, actor, action type, and resource.",
2442
+ "List audit log events for a Portkey workspace or organization. Returns paginated action-level records with actor, resource, metadata, and timestamps for compliance or incident review; use this instead of analytics when you need individual events, not aggregates.",
2443
2443
  AUDIT_TOOL_SCHEMAS.listAuditLogs,
2444
2444
  async (params) => {
2445
2445
  const result = await service.audit.listAuditLogs({
@@ -2519,7 +2519,7 @@ var COLLECTIONS_TOOL_SCHEMAS = {
2519
2519
  function registerCollectionsTools(server, service) {
2520
2520
  server.tool(
2521
2521
  "list_collections",
2522
- "List all prompt collections in your Portkey organization. Collections organize prompts by application (e.g., hourlink, apizone, research-pilot). Use to discover collection_id values before creating or listing prompts. Returns id, name, and slug per collection.",
2522
+ "List prompt collections in the workspace, optionally filtering by name or workspace. Returns ids, names, slugs, and timestamps so you can choose a collection_id before create_prompt, get_collection, or list_prompts.",
2523
2523
  COLLECTIONS_TOOL_SCHEMAS.listCollections,
2524
2524
  async (params) => {
2525
2525
  const collections = await service.collections.listCollections(params);
@@ -2549,7 +2549,7 @@ function registerCollectionsTools(server, service) {
2549
2549
  );
2550
2550
  server.tool(
2551
2551
  "create_collection",
2552
- "Create a new prompt collection for organizing prompts by app. Use one collection per app (hourlink, apizone, research-pilot). Returns the new collection_id and slug needed for create_prompt.",
2552
+ "Create a new prompt collection for organizing prompts by app. Use this when you need a new namespace before create_prompt; returns the collection id and slug, and does not move any prompts.",
2553
2553
  COLLECTIONS_TOOL_SCHEMAS.createCollection,
2554
2554
  async (params) => {
2555
2555
  const result = await service.collections.createCollection(params);
@@ -2573,7 +2573,7 @@ function registerCollectionsTools(server, service) {
2573
2573
  );
2574
2574
  server.tool(
2575
2575
  "get_collection",
2576
- "Retrieve full details of a specific collection by ID or slug, including name, slug, and workspace_id. Use get_collection when you have a specific ID; use list_collections to browse all collections.",
2576
+ "Fetch one collection by id or slug and return its name, slug, workspace, and timestamps. Use list_collections when browsing and get_collection when you already know the target.",
2577
2577
  COLLECTIONS_TOOL_SCHEMAS.getCollection,
2578
2578
  async (params) => {
2579
2579
  const collection = await service.collections.getCollection(
@@ -2602,7 +2602,7 @@ function registerCollectionsTools(server, service) {
2602
2602
  );
2603
2603
  server.tool(
2604
2604
  "update_collection",
2605
- "Update a collection's display name or description. Does not affect prompts within the collection.",
2605
+ "Update a collection's name or description only. This does not move prompts or change membership, so use it for metadata changes rather than reorganization.",
2606
2606
  COLLECTIONS_TOOL_SCHEMAS.updateCollection,
2607
2607
  async (params) => {
2608
2608
  await service.collections.updateCollection(params.collection_id, {
@@ -2628,7 +2628,7 @@ function registerCollectionsTools(server, service) {
2628
2628
  );
2629
2629
  server.tool(
2630
2630
  "delete_collection",
2631
- "Delete a prompt collection by ID. This action cannot be undone. Prompts inside the collection are not deleted but lose their grouping and move to the top level. Reassign prompts to another collection first if organization must be preserved.",
2631
+ "Delete a prompt collection by ID. This cannot be undone; prompts stay in the workspace but lose their collection grouping, so reassign them first if organization matters.",
2632
2632
  COLLECTIONS_TOOL_SCHEMAS.deleteCollection,
2633
2633
  async (params) => {
2634
2634
  const result = await service.collections.deleteCollection(
@@ -2726,7 +2726,7 @@ function hasConfigSettings(config) {
2726
2726
  function registerConfigsTools(server, service) {
2727
2727
  server.tool(
2728
2728
  "list_configs",
2729
- "Retrieve all configurations in your Portkey organization, including their status and workspace associations. Configs define request routing behavior (cache, retry, fallback, load balancing). Use to discover config slugs before inspecting or modifying them.",
2729
+ "List configs in the org with id, slug, name, status, workspace, and timestamps. Use this summary view to find a slug; use get_config for the full routing, cache, retry, and target settings before updating or deleting.",
2730
2730
  CONFIGS_TOOL_SCHEMAS.listConfigs,
2731
2731
  async () => {
2732
2732
  const configs = await service.configs.listConfigs();
@@ -2760,7 +2760,7 @@ function registerConfigsTools(server, service) {
2760
2760
  );
2761
2761
  server.tool(
2762
2762
  "get_config",
2763
- "Retrieve detailed information about a specific configuration, including cache settings, retry policies, routing strategy, and targets. Use when you need to inspect a config's full settings or clone an existing config's structure.",
2763
+ "Get one config by slug and return its routing, cache, retry, and target settings. Requires a known slug; use list_configs to discover one before editing.",
2764
2764
  CONFIGS_TOOL_SCHEMAS.getConfig,
2765
2765
  async (params) => {
2766
2766
  const response = await service.configs.getConfig(params.slug);
@@ -2804,7 +2804,7 @@ function registerConfigsTools(server, service) {
2804
2804
  );
2805
2805
  server.tool(
2806
2806
  "create_config",
2807
- "Create a new configuration that defines how AI requests are routed, cached, retried, and load-balanced across providers. At least one setting is required: cache (cache_mode/cache_max_age), retry (retry_attempts/retry_on_status_codes), strategy_mode, or targets.",
2807
+ "Create a config that defines routing, cache, retry, and targets for requests. At least one of those settings is required; returns the new id and version_id.",
2808
2808
  CONFIGS_TOOL_SCHEMAS.createConfig,
2809
2809
  async (params) => {
2810
2810
  const config = buildConfigPayload(params);
@@ -2844,7 +2844,7 @@ function registerConfigsTools(server, service) {
2844
2844
  );
2845
2845
  server.tool(
2846
2846
  "update_config",
2847
- "Update an existing configuration's cache, retry, or routing settings. Creates a new version; only provided fields are updated, unspecified fields remain unchanged.",
2847
+ "Update a config by slug and create a new version. Only provided fields change; name and status are editable, while the slug stays fixed. Use list_config_versions if you need history first.",
2848
2848
  CONFIGS_TOOL_SCHEMAS.updateConfig,
2849
2849
  async (params) => {
2850
2850
  const config = buildConfigPayload(params);
@@ -2879,7 +2879,7 @@ function registerConfigsTools(server, service) {
2879
2879
  );
2880
2880
  server.tool(
2881
2881
  "delete_config",
2882
- "Delete a configuration by slug. This action cannot be undone and removes all versions. Requests and API keys referencing this config slug will fail immediately. Use list_config_versions first to review history; audit dependent API keys before deleting.",
2882
+ "Delete a config by slug. This is permanent, removes all versions, and breaks anything still pointing at that slug; check list_config_versions first.",
2883
2883
  CONFIGS_TOOL_SCHEMAS.deleteConfig,
2884
2884
  async (params) => {
2885
2885
  const result = await service.configs.deleteConfig(params.slug);
@@ -2902,7 +2902,7 @@ function registerConfigsTools(server, service) {
2902
2902
  );
2903
2903
  server.tool(
2904
2904
  "list_config_versions",
2905
- "List all versions of a configuration to view its change history. Use to audit past changes, compare versions, or find a specific version ID for rollback.",
2905
+ "List every version of a config with version number, config payload, creator, and timestamp. Use this to audit history or compare revisions before update_config or delete_config.",
2906
2906
  CONFIGS_TOOL_SCHEMAS.listConfigVersions,
2907
2907
  async (params) => {
2908
2908
  const result = await service.configs.listConfigVersions(params.slug);
@@ -2984,7 +2984,7 @@ var GUARDRAILS_TOOL_SCHEMAS = {
2984
2984
  function registerGuardrailsTools(server, service) {
2985
2985
  server.tool(
2986
2986
  "list_guardrails",
2987
- "List all guardrails in your Portkey organization with optional filtering by workspace or organization. Guardrails are content moderation and security policies applied to AI requests. Use to discover guardrail IDs and slugs before inspecting or modifying them.",
2987
+ "List guardrails in the org with id, slug, status, ownership, and optional workspace/org filters. Use this to find IDs and slugs before get_guardrail, update_guardrail, or delete_guardrail.",
2988
2988
  GUARDRAILS_TOOL_SCHEMAS.listGuardrails,
2989
2989
  async (params) => {
2990
2990
  const result = await service.guardrails.listGuardrails(params);
@@ -3018,7 +3018,7 @@ function registerGuardrailsTools(server, service) {
3018
3018
  );
3019
3019
  server.tool(
3020
3020
  "get_guardrail",
3021
- "Retrieve detailed information about a specific guardrail, including its full checks and actions configuration. Use when you need to inspect or modify a guardrail's rules, or to understand what checks are applied before updating.",
3021
+ "Fetch one guardrail with its full checks and actions. Use this before updating rules or when you need the exact enforcement policy.",
3022
3022
  GUARDRAILS_TOOL_SCHEMAS.getGuardrail,
3023
3023
  async (params) => {
3024
3024
  const guardrail = await service.guardrails.getGuardrail(
@@ -3053,7 +3053,7 @@ function registerGuardrailsTools(server, service) {
3053
3053
  );
3054
3054
  server.tool(
3055
3055
  "create_guardrail",
3056
- "Create a new guardrail with specified checks and actions for content moderation and security. Guardrails are applied to requests via configs -- create the guardrail first, then reference it in a config. checks is an array of check objects with id (e.g. 'default.jwt', 'default.pii'), optional name, is_enabled boolean, and parameters object.",
3056
+ "Create a guardrail with checks and actions for request filtering. Create it first, then reference it from configs; the new version becomes the policy anchor for downstream use.",
3057
3057
  GUARDRAILS_TOOL_SCHEMAS.createGuardrail,
3058
3058
  async (params) => {
3059
3059
  const result = await service.guardrails.createGuardrail({
@@ -3084,7 +3084,7 @@ function registerGuardrailsTools(server, service) {
3084
3084
  );
3085
3085
  server.tool(
3086
3086
  "update_guardrail",
3087
- "Update an existing guardrail's name, checks, or actions configuration. Creates a new version of the guardrail; existing references in configs continue working with the latest version.",
3087
+ "Update a guardrail's name, checks, or actions. This creates a new version, so configs keep pointing at the latest policy after the change.",
3088
3088
  GUARDRAILS_TOOL_SCHEMAS.updateGuardrail,
3089
3089
  async (params) => {
3090
3090
  const updateData = {};
@@ -3122,7 +3122,7 @@ function registerGuardrailsTools(server, service) {
3122
3122
  );
3123
3123
  server.tool(
3124
3124
  "delete_guardrail",
3125
- "Delete a guardrail by its ID or slug. This action cannot be undone. Configs referencing this guardrail as a before/after request hook will stop enforcing it, silently dropping the safety check. Review dependent configs before deleting.",
3125
+ "Delete a guardrail by id or slug. This is irreversible and removes the check from any configs that reference it, so review dependent configs first.",
3126
3126
  GUARDRAILS_TOOL_SCHEMAS.deleteGuardrail,
3127
3127
  async (params) => {
3128
3128
  const result = await service.guardrails.deleteGuardrail(
@@ -3285,7 +3285,7 @@ var INTEGRATIONS_TOOL_SCHEMAS = {
3285
3285
  function registerIntegrationsTools(server, service) {
3286
3286
  server.tool(
3287
3287
  "list_integrations",
3288
- "List org-level connections to AI providers (OpenAI, Anthropic, Azure, etc.) with optional filtering by workspace or type. Use to discover integration slugs for other integration tools. Returns paginated results with id, slug, provider, and status. Differs from list_providers, which shows workspace-scoped provider instances.",
3288
+ "List org-level AI provider connections with optional workspace or type filters. Use this to find integration slugs before model or workspace updates. Returns total plus id, name, slug, provider, status, description, workspace counts, and config summary.",
3289
3289
  INTEGRATIONS_TOOL_SCHEMAS.listIntegrations,
3290
3290
  async (params) => {
3291
3291
  const integrations = await service.integrations.listIntegrations({
@@ -3323,7 +3323,7 @@ function registerIntegrationsTools(server, service) {
3323
3323
  );
3324
3324
  server.tool(
3325
3325
  "create_integration",
3326
- "Create a new integration with an AI provider (e.g., OpenAI, Anthropic, Azure OpenAI, AWS Bedrock). Provider-specific params: Azure needs api_version + resource_name + deployment_name. AWS needs aws_region. Vertex AI needs vertex_project_id + vertex_region.",
3326
+ "Create an org-level provider integration. Some backends need provider-specific fields, and the new integration becomes the source for downstream providers and workspace access. Returns the new integration id and slug.",
3327
3327
  INTEGRATIONS_TOOL_SCHEMAS.createIntegration,
3328
3328
  async (params) => {
3329
3329
  const configurations = {};
@@ -3371,7 +3371,7 @@ function registerIntegrationsTools(server, service) {
3371
3371
  );
3372
3372
  server.tool(
3373
3373
  "get_integration",
3374
- "Retrieve detailed information about a specific integration by its slug. Returns full config including masked API key, workspace access settings, and allowed models. Use when you need provider-specific details or to audit an integration's configuration.",
3374
+ "Fetch one integration by slug, including masked key, workspace access, allowed models, and configuration metadata. Use this before editing provider-specific settings or auditing access.",
3375
3375
  INTEGRATIONS_TOOL_SCHEMAS.getIntegration,
3376
3376
  async (params) => {
3377
3377
  const integration = await service.integrations.getIntegration(
@@ -3408,7 +3408,7 @@ function registerIntegrationsTools(server, service) {
3408
3408
  );
3409
3409
  server.tool(
3410
3410
  "update_integration",
3411
- "Update an existing integration's name, API key, description, or provider-specific configurations. API key changes take effect immediately. Changing provider-specific configs (Azure resource_name, Vertex region, etc.) may break active requests using this integration.",
3411
+ "Update an integration's name, key, or provider-specific config. Key and config changes take effect immediately and can disrupt dependent providers or live requests.",
3412
3412
  INTEGRATIONS_TOOL_SCHEMAS.updateIntegration,
3413
3413
  async (params) => {
3414
3414
  const configurations = {};
@@ -3455,7 +3455,7 @@ function registerIntegrationsTools(server, service) {
3455
3455
  );
3456
3456
  server.tool(
3457
3457
  "delete_integration",
3458
- "Delete an integration by slug. This action cannot be undone. Removes the org-level provider connection; all dependent virtual keys and providers will stop working.",
3458
+ "Delete an integration by slug. This is irreversible and stops the org-level connection, which will break dependent virtual keys, providers, and workspace access.",
3459
3459
  INTEGRATIONS_TOOL_SCHEMAS.deleteIntegration,
3460
3460
  async (params) => {
3461
3461
  const result = await service.integrations.deleteIntegration(params.slug);
@@ -3478,7 +3478,7 @@ function registerIntegrationsTools(server, service) {
3478
3478
  );
3479
3479
  server.tool(
3480
3480
  "list_integration_models",
3481
- "List which AI models are enabled for a specific integration, with their enabled/disabled status and custom flag. Use to check model availability before creating prompts or configs. Returns paginated results with model id, name, and enabled state.",
3481
+ "List models enabled on an integration. Use this to verify model availability before creating prompts or configs. Returns total plus model ids, display names, enabled state, and custom-model markers.",
3482
3482
  INTEGRATIONS_TOOL_SCHEMAS.listIntegrationModels,
3483
3483
  async (params) => {
3484
3484
  const models = await service.integrations.listIntegrationModels(
@@ -3516,7 +3516,7 @@ function registerIntegrationsTools(server, service) {
3516
3516
  );
3517
3517
  server.tool(
3518
3518
  "update_integration_models",
3519
- "Enable/disable specific models or register custom model names for an integration. Changes affect all workspaces using this integration. Pass an array of model configurations with slug, enabled state, and optional is_custom flag.",
3519
+ "Enable, disable, or register custom models for an integration. This changes model availability for every workspace using it, so confirm the downstream impact first. Returns success and the number of models updated.",
3520
3520
  INTEGRATIONS_TOOL_SCHEMAS.updateIntegrationModels,
3521
3521
  async (params) => {
3522
3522
  const result = await service.integrations.updateIntegrationModels(
@@ -3545,7 +3545,7 @@ function registerIntegrationsTools(server, service) {
3545
3545
  );
3546
3546
  server.tool(
3547
3547
  "delete_integration_model",
3548
- "Delete a specific custom model from an integration. Only custom models can be deleted; built-in models should be disabled via update_integration_models instead. Returns success status.",
3548
+ "Delete a custom model from an integration. Built-in models should be disabled instead, because deletion only applies to custom entries. Returns success after the custom model is removed.",
3549
3549
  INTEGRATIONS_TOOL_SCHEMAS.deleteIntegrationModel,
3550
3550
  async (params) => {
3551
3551
  const result = await service.integrations.deleteIntegrationModel(
@@ -3571,7 +3571,7 @@ function registerIntegrationsTools(server, service) {
3571
3571
  );
3572
3572
  server.tool(
3573
3573
  "list_integration_workspaces",
3574
- "List which workspaces can access a specific integration, including their usage limits and rate limits. Use to audit workspace access and review per-workspace spending/rate configurations. Returns paginated results.",
3574
+ "List workspaces that can use an integration, with their limits. Use this to audit access or confirm per-workspace cost and rate settings. Returns total plus workspace ids, names, enabled state, usage limits, and rate limits.",
3575
3575
  INTEGRATIONS_TOOL_SCHEMAS.listIntegrationWorkspaces,
3576
3576
  async (params) => {
3577
3577
  const workspaces = await service.integrations.listIntegrationWorkspaces(
@@ -3610,7 +3610,7 @@ function registerIntegrationsTools(server, service) {
3610
3610
  );
3611
3611
  server.tool(
3612
3612
  "update_integration_workspaces",
3613
- "Control which workspaces can use an integration and set per-workspace usage/rate limits. Pass an array of workspace configurations with id, enabled state, and optional credit_limit, alert_threshold, and rate_limit_rpm.",
3613
+ "Control which workspaces can use an integration and set per-workspace limits. Access changes and new limits apply to downstream usage immediately. Returns success and the number of workspaces updated.",
3614
3614
  INTEGRATIONS_TOOL_SCHEMAS.updateIntegrationWorkspaces,
3615
3615
  async (params) => {
3616
3616
  const result = await service.integrations.updateIntegrationWorkspaces(
@@ -3738,7 +3738,7 @@ var KEYS_TOOL_SCHEMAS = {
3738
3738
  function registerKeysTools(server, service) {
3739
3739
  server.tool(
3740
3740
  "list_virtual_keys",
3741
- "List virtual keys that securely store provider API keys (OpenAI, Anthropic, etc.) in your Portkey organization. Use to discover virtual key slugs referenced in prompts and configs. Returns all keys with their usage limits, rate limits, and status.",
3741
+ "List provider API keys stored as virtual keys in your Portkey org. Use this to find slugs before wiring prompts/configs or auditing limits. Returns total plus name, slug, status, usage limits, rate limits, reset state, and model config.",
3742
3742
  KEYS_TOOL_SCHEMAS.listVirtualKeys,
3743
3743
  async () => {
3744
3744
  const virtualKeys = await service.keys.listVirtualKeys();
@@ -3779,7 +3779,7 @@ function registerKeysTools(server, service) {
3779
3779
  );
3780
3780
  server.tool(
3781
3781
  "create_virtual_key",
3782
- "Securely store a provider API key as a virtual key. The original key is encrypted and never returned after creation. Use the returned slug to reference this key in prompts and configs. Supports optional usage/rate limits.",
3782
+ "Store a provider API key as a virtual key. The raw key is encrypted and only returned at creation time, so save the returned slug and use it in prompts/configs. Optional usage and rate limits apply immediately, and the tool returns the new slug.",
3783
3783
  KEYS_TOOL_SCHEMAS.createVirtualKey,
3784
3784
  async (params) => {
3785
3785
  const result = await service.keys.createVirtualKey({
@@ -3818,7 +3818,7 @@ function registerKeysTools(server, service) {
3818
3818
  );
3819
3819
  server.tool(
3820
3820
  "get_virtual_key",
3821
- "Retrieve detailed information about a specific virtual key by its slug. Returns key metadata with a masked version of the stored API key. Use to check usage limits, rate limits, and status.",
3821
+ "Fetch one virtual key by slug, including metadata, a masked secret, limits, status, and model config. Use this before updating or to inspect the current configuration.",
3822
3822
  KEYS_TOOL_SCHEMAS.getVirtualKey,
3823
3823
  async (params) => {
3824
3824
  const virtualKey = await service.keys.getVirtualKey(params.slug);
@@ -3856,7 +3856,7 @@ function registerKeysTools(server, service) {
3856
3856
  );
3857
3857
  server.tool(
3858
3858
  "update_virtual_key",
3859
- "Update an existing virtual key's name, API key, note, or limits. Can rotate the underlying provider API key by passing a new key value. Changes to limits take effect immediately.",
3859
+ "Update a virtual key's name, secret, note, or limits. Rotating the key takes effect immediately, and limit changes apply to downstream prompts and configs using this slug. Returns the updated name, slug, and status.",
3860
3860
  KEYS_TOOL_SCHEMAS.updateVirtualKey,
3861
3861
  async (params) => {
3862
3862
  const result = await service.keys.updateVirtualKey(params.slug, {
@@ -3890,7 +3890,7 @@ function registerKeysTools(server, service) {
3890
3890
  );
3891
3891
  server.tool(
3892
3892
  "delete_virtual_key",
3893
- "Delete a virtual key by slug. This action cannot be undone. Prompts and configs referencing this key will fail; ensure no active resources depend on it before deleting.",
3893
+ "Delete a virtual key by slug. This is irreversible and will break prompts and configs that reference the slug, so confirm no active dependencies first. Returns success after removal.",
3894
3894
  KEYS_TOOL_SCHEMAS.deleteVirtualKey,
3895
3895
  async (params) => {
3896
3896
  const result = await service.keys.deleteVirtualKey(params.slug);
@@ -3913,7 +3913,7 @@ function registerKeysTools(server, service) {
3913
3913
  );
3914
3914
  server.tool(
3915
3915
  "create_api_key",
3916
- "Create a new Portkey API key for authentication. Organisation-level keys provide full access, workspace keys are scoped. Scopes control read/write permissions to specific resources (logs, analytics, prompts, etc.). Returns the key value only once at creation time \u2014 save it immediately.",
3916
+ "Create a Portkey API key for auth. Org keys grant broader access; workspace keys are scoped. The secret is only returned once, and using the key grants access immediately according to its scopes, defaults, and limits. Workspace keys require workspace_id and user keys require user_id.",
3917
3917
  KEYS_TOOL_SCHEMAS.createApiKey,
3918
3918
  async (params) => {
3919
3919
  if (params.type === "workspace" && !params.workspace_id) {
@@ -3984,7 +3984,7 @@ function registerKeysTools(server, service) {
3984
3984
  );
3985
3985
  server.tool(
3986
3986
  "list_api_keys",
3987
- "List Portkey API keys (not provider keys \u2014 use list_virtual_keys for those) with optional pagination and workspace filtering. Use to audit access and review key scopes, limits, and expiration across your organization.",
3987
+ "List Portkey API keys for auditing access, scopes, defaults, limits, and expiration. Use this for API keys only; use list_virtual_keys for provider keys. Returns total plus id, type, status, workspace/user scope, limits, defaults, alert emails, and creation mode.",
3988
3988
  KEYS_TOOL_SCHEMAS.listApiKeys,
3989
3989
  async (params) => {
3990
3990
  const apiKeys = await service.keys.listApiKeys({
@@ -4037,7 +4037,7 @@ function registerKeysTools(server, service) {
4037
4037
  );
4038
4038
  server.tool(
4039
4039
  "get_api_key",
4040
- "Retrieve detailed information about a specific API key by its UUID. Returns key metadata without the secret key value. Use to check scopes, usage/rate limits, defaults, and expiration.",
4040
+ "Fetch one API key by UUID without revealing the secret. Use this to inspect scopes, defaults, limits, expiration, and reset state before changing access.",
4041
4041
  KEYS_TOOL_SCHEMAS.getApiKey,
4042
4042
  async (params) => {
4043
4043
  const apiKey = await service.keys.getApiKey(params.id);
@@ -4084,7 +4084,7 @@ function registerKeysTools(server, service) {
4084
4084
  );
4085
4085
  server.tool(
4086
4086
  "update_api_key",
4087
- "Update an existing API key's name, description, scopes, or limits. Can modify scopes, usage/rate limits, defaults, and expiration. Cannot change key type or sub_type after creation.",
4087
+ "Update an API key's name, description, scopes, defaults, or limits. Changes affect what downstream callers can access; type and sub-type stay fixed after creation. Returns success after the update is applied.",
4088
4088
  KEYS_TOOL_SCHEMAS.updateApiKey,
4089
4089
  async (params) => {
4090
4090
  const result = await service.keys.updateApiKey(params.id, {
@@ -4122,7 +4122,7 @@ function registerKeysTools(server, service) {
4122
4122
  );
4123
4123
  server.tool(
4124
4124
  "delete_api_key",
4125
- "Delete an API key by UUID. This action cannot be undone. Immediately revokes authentication; active sessions using this key will fail.",
4125
+ "Delete an API key by UUID. This cannot be undone, revokes access immediately, and can break active sessions using the key. Returns success after revocation.",
4126
4126
  KEYS_TOOL_SCHEMAS.deleteApiKey,
4127
4127
  async (params) => {
4128
4128
  const result = await service.keys.deleteApiKey(params.id);
@@ -4182,7 +4182,7 @@ var LABELS_TOOL_SCHEMAS = {
4182
4182
  function registerLabelsTools(server, service) {
4183
4183
  server.tool(
4184
4184
  "create_prompt_label",
4185
- "Create a new prompt label to categorize prompt versions (e.g., 'production', 'staging', 'experiment'). Requires either organisation_id or workspace_id to set the label's scope. Returns the new label's id. Use update_prompt_version to assign labels to specific prompt versions.",
4185
+ "Create a prompt label for tagging prompt versions such as production, staging, or experiment. Requires either organisation_id or workspace_id to set scope, returns the new label id, and does not assign it to any versions yet.",
4186
4186
  LABELS_TOOL_SCHEMAS.createPromptLabel,
4187
4187
  async (params) => {
4188
4188
  if (!params.organisation_id && !params.workspace_id) {
@@ -4222,7 +4222,7 @@ function registerLabelsTools(server, service) {
4222
4222
  );
4223
4223
  server.tool(
4224
4224
  "list_prompt_labels",
4225
- "List all prompt labels with optional filtering by workspace, organisation, or search query. Returns id, name, color_code, and status for each label. Use to discover label IDs before assigning them to prompt versions via update_prompt_version.",
4225
+ "List labels across the workspace or organisation, with optional search and scope filters. Returns ids, names, colors, status, and timestamps so you can choose a label_id before get_prompt_label or update_prompt_version.",
4226
4226
  LABELS_TOOL_SCHEMAS.listPromptLabels,
4227
4227
  async (params) => {
4228
4228
  const result = await service.labels.listLabels(params);
@@ -4254,7 +4254,7 @@ function registerLabelsTools(server, service) {
4254
4254
  );
4255
4255
  server.tool(
4256
4256
  "get_prompt_label",
4257
- "Retrieve full details of a specific prompt label including its scope (organisation_id vs workspace_id), color, and status. Use when you need to inspect a label's properties before updating it.",
4257
+ "Fetch one label's full definition, including scope, color, and status. Use this when you already know the label_id; list_prompt_labels is better for browsing candidates.",
4258
4258
  LABELS_TOOL_SCHEMAS.getPromptLabel,
4259
4259
  async (params) => {
4260
4260
  const label = await service.labels.getLabel(params.label_id, {
@@ -4288,7 +4288,7 @@ function registerLabelsTools(server, service) {
4288
4288
  );
4289
4289
  server.tool(
4290
4290
  "update_prompt_label",
4291
- "Update a prompt label's name, description, or color_code. Changes apply to the label definition only; existing prompt version assignments using this label are not affected.",
4291
+ "Update a prompt label's name, description, or color only. This changes the label definition, not existing prompt-version assignments or history.",
4292
4292
  LABELS_TOOL_SCHEMAS.updatePromptLabel,
4293
4293
  async (params) => {
4294
4294
  const { label_id, ...updateData } = params;
@@ -4312,7 +4312,7 @@ function registerLabelsTools(server, service) {
4312
4312
  );
4313
4313
  server.tool(
4314
4314
  "delete_prompt_label",
4315
- "Delete a prompt label by ID. This action cannot be undone. Prompt versions carrying this label lose it, and any workflow resolving prompts by this label (e.g., 'production', 'staging') will fail until reassigned. Audit label usage via list_prompts before deleting.",
4315
+ "Delete a prompt label by ID. This cannot be undone; versions carrying the label lose it, and any workflow resolving by that label will need a replacement.",
4316
4316
  LABELS_TOOL_SCHEMAS.deletePromptLabel,
4317
4317
  async (params) => {
4318
4318
  await service.labels.deleteLabel(params.label_id);
@@ -4464,7 +4464,7 @@ function formatUsageLimitEntity(entity) {
4464
4464
  function registerLimitsTools(server, service) {
4465
4465
  server.tool(
4466
4466
  "list_rate_limits",
4467
- "Retrieve all rate limits in your Portkey organization. Use to discover existing rate limit policies before creating new ones. Returns an array of rate limits each containing id, type, unit, value, and status. Rate limits control how many requests or tokens can be consumed per time unit (rpm/rph/rpd).",
4467
+ "List rate limits in the org with id, type, unit, value, status, scope, conditions, and grouping. Use this to find an existing policy before get_rate_limit, update_rate_limit, or delete_rate_limit.",
4468
4468
  LIMITS_TOOL_SCHEMAS.listRateLimits,
4469
4469
  async (params) => {
4470
4470
  const result = await service.limits.listRateLimits(params.workspace_id);
@@ -4487,7 +4487,7 @@ function registerLimitsTools(server, service) {
4487
4487
  );
4488
4488
  server.tool(
4489
4489
  "get_rate_limit",
4490
- "Retrieve detailed information about a specific rate limit by its ID. Returns full detail including conditions and group_by fields. Use when you have a specific rate limit ID from list_rate_limits and need to inspect its complete configuration.",
4490
+ "Get one rate limit by id and return its full conditions and grouping definition. Use list_rate_limits to discover ids or compare policies first.",
4491
4491
  LIMITS_TOOL_SCHEMAS.getRateLimit,
4492
4492
  async (params) => {
4493
4493
  const result = await service.limits.getRateLimit(params.id);
@@ -4503,7 +4503,7 @@ function registerLimitsTools(server, service) {
4503
4503
  );
4504
4504
  server.tool(
4505
4505
  "create_rate_limit",
4506
- "Create a new rate limit policy to throttle requests in real-time by controlling request/token consumption per time unit. Differs from usage limits, which cap cumulative consumption over time. Requires conditions to match against and group_by to specify how limits are applied.",
4506
+ "Create a request or token throttle with conditions, group_by, type, unit, and value. conditions and group_by are required; use usage limits when you need a cumulative budget instead.",
4507
4507
  LIMITS_TOOL_SCHEMAS.createRateLimit,
4508
4508
  async (params) => {
4509
4509
  const result = await service.limits.createRateLimit({
@@ -4535,7 +4535,7 @@ function registerLimitsTools(server, service) {
4535
4535
  );
4536
4536
  server.tool(
4537
4537
  "update_rate_limit",
4538
- "Update an existing rate limit's name, unit, or value. Only name, unit, and value can be changed after creation; conditions and group_by are immutable. Returns the updated rate limit object.",
4538
+ "Update a rate limit's name, unit, or value by id. Conditions and group_by are immutable after creation; use get_rate_limit first if you need the full policy.",
4539
4539
  LIMITS_TOOL_SCHEMAS.updateRateLimit,
4540
4540
  async (params) => {
4541
4541
  const result = await service.limits.updateRateLimit(params.id, {
@@ -4562,7 +4562,7 @@ function registerLimitsTools(server, service) {
4562
4562
  );
4563
4563
  server.tool(
4564
4564
  "delete_rate_limit",
4565
- "Delete a rate limit policy by ID. This action cannot be undone. Requests previously throttled by this policy will no longer be limited; review dependent configs and virtual keys first to avoid unexpected traffic spikes.",
4565
+ "Delete a rate limit by id. This is permanent and removes throttling immediately; review dependent configs and virtual keys before deleting.",
4566
4566
  LIMITS_TOOL_SCHEMAS.deleteRateLimit,
4567
4567
  async (params) => {
4568
4568
  await service.limits.deleteRateLimit(params.id);
@@ -4585,7 +4585,7 @@ function registerLimitsTools(server, service) {
4585
4585
  );
4586
4586
  server.tool(
4587
4587
  "list_usage_limits",
4588
- "Retrieve all usage limits in your Portkey organization. Differs from rate limits: usage limits cap total cumulative cost or tokens over time, optionally resetting on a weekly or monthly schedule. Returns an array of usage limits with id, type, credit_limit, status, and reset schedule.",
4588
+ "List usage limits in the org with id, type, credit_limit, status, reset schedule, scope, conditions, and grouping. Use this before get_usage_limit, update_usage_limit, or delete_usage_limit.",
4589
4589
  LIMITS_TOOL_SCHEMAS.listUsageLimits,
4590
4590
  async (params) => {
4591
4591
  const result = await service.limits.listUsageLimits(params.workspace_id);
@@ -4608,7 +4608,7 @@ function registerLimitsTools(server, service) {
4608
4608
  );
4609
4609
  server.tool(
4610
4610
  "get_usage_limit",
4611
- "Retrieve detailed information about a specific usage limit by its ID. Returns full detail including conditions, group_by, credit_limit, alert_threshold, and periodic reset schedule.",
4611
+ "Get one usage limit by id and return its full budget, threshold, grouping, and reset details. Use list_usage_limits to discover ids or compare policies first.",
4612
4612
  LIMITS_TOOL_SCHEMAS.getUsageLimit,
4613
4613
  async (params) => {
4614
4614
  const result = await service.limits.getUsageLimit(params.id);
@@ -4624,7 +4624,7 @@ function registerLimitsTools(server, service) {
4624
4624
  );
4625
4625
  server.tool(
4626
4626
  "create_usage_limit",
4627
- "Create a new usage limit policy to enforce spending or token budgets over time. Differs from rate limits, which control real-time request velocity. Requires conditions to match against and group_by to specify how limits are applied. Supports optional periodic resets and alert thresholds.",
4627
+ "Create a cumulative budget for cost or tokens with optional alerts and weekly or monthly resets. conditions and group_by are required; use rate limits when you need request throttling.",
4628
4628
  LIMITS_TOOL_SCHEMAS.createUsageLimit,
4629
4629
  async (params) => {
4630
4630
  const result = await service.limits.createUsageLimit({
@@ -4657,7 +4657,7 @@ function registerLimitsTools(server, service) {
4657
4657
  );
4658
4658
  server.tool(
4659
4659
  "update_usage_limit",
4660
- "Update an existing usage limit's configuration. Modifiable fields: name, credit_limit, alert_threshold, periodic_reset, and reset_usage_for_value. Conditions and group_by are immutable after creation.",
4660
+ "Update a usage limit's name, credit_limit, alert_threshold, reset schedule, or reset target by id. Conditions and group_by are immutable after creation.",
4661
4661
  LIMITS_TOOL_SCHEMAS.updateUsageLimit,
4662
4662
  async (params) => {
4663
4663
  const result = await service.limits.updateUsageLimit(params.id, {
@@ -4686,7 +4686,7 @@ function registerLimitsTools(server, service) {
4686
4686
  );
4687
4687
  server.tool(
4688
4688
  "delete_usage_limit",
4689
- "Delete a usage limit policy by ID. This action cannot be undone. Budgets and quotas enforced by this policy are removed immediately and tracked entities lose accumulated usage state. Use list_usage_limit_entities first to review impact before deleting.",
4689
+ "Delete a usage limit by id. This is permanent, removes the budget immediately, and clears tracked usage state; check list_usage_limit_entities first if you need impact.",
4690
4690
  LIMITS_TOOL_SCHEMAS.deleteUsageLimit,
4691
4691
  async (params) => {
4692
4692
  await service.limits.deleteUsageLimit(params.id);
@@ -4709,7 +4709,7 @@ function registerLimitsTools(server, service) {
4709
4709
  );
4710
4710
  server.tool(
4711
4711
  "list_usage_limit_entities",
4712
- "List all entities (individual keys, users, or groups) tracked against a usage limit policy. Shows current consumption per entity, useful for monitoring who is approaching or has exceeded their budget.",
4712
+ "List the entities currently tracked against a usage limit, including current usage. Use this to see who is near or over budget before reset_usage_limit_entity or delete_usage_limit.",
4713
4713
  LIMITS_TOOL_SCHEMAS.listUsageLimitEntities,
4714
4714
  async (params) => {
4715
4715
  const result = await service.limits.listUsageLimitEntities(
@@ -4734,7 +4734,7 @@ function registerLimitsTools(server, service) {
4734
4734
  );
4735
4735
  server.tool(
4736
4736
  "reset_usage_limit_entity",
4737
- "Reset the accumulated usage counter to zero for a specific entity on a usage limit policy. Does not delete the entity or the policy itself. Use when an entity needs its budget restored before the next scheduled periodic reset.",
4737
+ "Reset tracked usage for one entity under a usage limit. This changes accumulated usage for that entity only; use list_usage_limit_entities to confirm the target first.",
4738
4738
  LIMITS_TOOL_SCHEMAS.resetUsageLimitEntity,
4739
4739
  async (params) => {
4740
4740
  await service.limits.resetUsageLimitEntity(
@@ -4851,7 +4851,7 @@ var LOGGING_TOOL_SCHEMAS = {
4851
4851
  function registerLoggingTools(server, service) {
4852
4852
  server.tool(
4853
4853
  "insert_log",
4854
- "Insert a log entry (or multiple entries) into Portkey for tracking AI requests and responses. Use this for external or custom logs not routed through the Portkey gateway. request_provider must match a configured integration (e.g. 'openai', 'anthropic'). Use metadata_span_id and metadata_parent_span_id to create trace hierarchies.",
4854
+ "Insert log records for requests that bypassed the gateway. This writes request, response, and trace metadata into Portkey immediately, and the call will fail if request_provider does not match a configured integration. Use the span fields to stitch trace hierarchies together.",
4855
4855
  LOGGING_TOOL_SCHEMAS.insertLog,
4856
4856
  async (params) => {
4857
4857
  const entry = {
@@ -4899,7 +4899,7 @@ function registerLoggingTools(server, service) {
4899
4899
  );
4900
4900
  server.tool(
4901
4901
  "create_log_export",
4902
- "Create a new log export job definition with filters and field selection. This only creates the job \u2014 you must call start_log_export to begin processing, then poll get_log_export to check status. time_min/time_max accept ISO 8601 format ('2024-01-01T00:00:00Z'). Returns the export ID and matching log count.",
4902
+ "Create a log export definition with filters and requested fields. This only sets up the export and does not start processing; call start_log_export next, then use get_log_export or download_log_export to inspect or retrieve the finished result.",
4903
4903
  LOGGING_TOOL_SCHEMAS.createLogExport,
4904
4904
  async (params) => {
4905
4905
  const result = await service.logging.createLogExport({
@@ -4937,7 +4937,7 @@ function registerLoggingTools(server, service) {
4937
4937
  );
4938
4938
  server.tool(
4939
4939
  "list_log_exports",
4940
- "List all log export jobs for a workspace. Returns each export with its current status (pending/running/completed/failed), filters, and timestamps. Use this to find export_ids for subsequent get, start, cancel, or download operations.",
4940
+ "List log export jobs in a workspace with status, filters, and timestamps. Use this to find an export_id before calling get_log_export, start_log_export, cancel_log_export, or download_log_export.",
4941
4941
  LOGGING_TOOL_SCHEMAS.listLogExports,
4942
4942
  async (params) => {
4943
4943
  const result = await service.logging.listLogExports({
@@ -4972,7 +4972,7 @@ function registerLoggingTools(server, service) {
4972
4972
  );
4973
4973
  server.tool(
4974
4974
  "get_log_export",
4975
- "Get details of a specific log export by its ID. Use this to check the current status of an export (pending/running/completed/failed) and view its full configuration. Unlike list_log_exports which returns summaries of all exports, this returns complete detail for a single export including filters and requested fields.",
4975
+ "Fetch one log export job by export_id and return its status, filters, requested fields, and file metadata. Use this when you already know the target; use list_log_exports for a workspace-wide overview.",
4976
4976
  LOGGING_TOOL_SCHEMAS.getLogExport,
4977
4977
  async (params) => {
4978
4978
  const result = await service.logging.getLogExport(params.export_id);
@@ -5003,7 +5003,7 @@ function registerLoggingTools(server, service) {
5003
5003
  );
5004
5004
  server.tool(
5005
5005
  "start_log_export",
5006
- "Trigger processing of a previously created log export job. You must call create_log_export first to define the export before starting it. After starting, poll get_log_export to monitor progress until status is 'completed', then use download_log_export to retrieve results.",
5006
+ "Start processing a previously created log export job. This is asynchronous, only queues the export, and does not return rows or a download file; use get_log_export to poll progress and download_log_export after the job completes.",
5007
5007
  LOGGING_TOOL_SCHEMAS.startLogExport,
5008
5008
  async (params) => {
5009
5009
  const result = await service.logging.startLogExport(params.export_id);
@@ -5027,7 +5027,7 @@ function registerLoggingTools(server, service) {
5027
5027
  );
5028
5028
  server.tool(
5029
5029
  "cancel_log_export",
5030
- "Cancel a running or pending log export job. This permanently stops the export \u2014 it cannot be resumed after cancellation. To export the same data, create a new export job with create_log_export.",
5030
+ "Cancel a pending or running log export job. This permanently stops that export, so create a new log export if you need the same data again.",
5031
5031
  LOGGING_TOOL_SCHEMAS.cancelLogExport,
5032
5032
  async (params) => {
5033
5033
  const result = await service.logging.cancelLogExport(params.export_id);
@@ -5051,7 +5051,7 @@ function registerLoggingTools(server, service) {
5051
5051
  );
5052
5052
  server.tool(
5053
5053
  "download_log_export",
5054
- "Get the download URL for a completed log export. Export must be in 'completed' status. Workflow: create_log_export -> start_log_export -> poll get_log_export until completed -> download_log_export.",
5054
+ "Get a signed URL for downloading a completed log export. The export must already be finished; use get_log_export to confirm readiness and start_log_export if it has not run yet.",
5055
5055
  LOGGING_TOOL_SCHEMAS.downloadLogExport,
5056
5056
  async (params) => {
5057
5057
  const result = await service.logging.downloadLogExport(params.export_id);
@@ -5075,7 +5075,7 @@ function registerLoggingTools(server, service) {
5075
5075
  );
5076
5076
  server.tool(
5077
5077
  "update_log_export",
5078
- "Update an existing log export configuration. Only time_of_generation_max, requested_fields, and workspace_id can be modified after creation.",
5078
+ "Update an existing log export configuration before or between export runs. Only workspace_id, time_of_generation_max, and requested_fields can change after creation, so use get_log_export to review the current job and start_log_export after the definition is ready.",
5079
5079
  LOGGING_TOOL_SCHEMAS.updateLogExport,
5080
5080
  async (params) => {
5081
5081
  const updateData = {};
@@ -5242,7 +5242,7 @@ function formatMcpIntegrationWorkspace(workspace) {
5242
5242
  function registerMcpIntegrationsTools(server, service) {
5243
5243
  server.tool(
5244
5244
  "list_mcp_integrations",
5245
- "List all MCP integrations in your Portkey organization with optional pagination and workspace filtering. MCP integrations connect external MCP servers to your Portkey org. Use to discover integration IDs needed by other tools. Differs from list_mcp_servers which shows server instances under an integration. Returns paginated array of integrations with total count and has_more flag.",
5245
+ "List MCP integrations in the organization. Returns paginated integration records plus total and has_more for discovering integration IDs; use get_mcp_integration for one integration's full Portkey-side config and list_mcp_servers for the servers under an integration.",
5246
5246
  MCP_INTEGRATIONS_TOOL_SCHEMAS.listMcpIntegrations,
5247
5247
  async (params) => {
5248
5248
  const result = await service.mcpIntegrations.listMcpIntegrations(params);
@@ -5266,7 +5266,7 @@ function registerMcpIntegrationsTools(server, service) {
5266
5266
  );
5267
5267
  server.tool(
5268
5268
  "create_mcp_integration",
5269
- "Create a new MCP integration by registering an external MCP server URL with auth configuration. After creation, use create_mcp_server to add server instances and update_mcp_integration_capabilities to control which tools are exposed. Returns the new integration's id and slug.",
5269
+ "Create an MCP integration from an external server URL. Registers the Portkey-side connection and returns the new id and slug; if auth_type is headers, custom_headers are required, and you usually follow with create_mcp_server and capability updates.",
5270
5270
  MCP_INTEGRATIONS_TOOL_SCHEMAS.createMcpIntegration,
5271
5271
  async (params) => {
5272
5272
  if (params.auth_type === "headers" && (!params.custom_headers || Object.keys(params.custom_headers).length === 0)) {
@@ -5305,7 +5305,7 @@ function registerMcpIntegrationsTools(server, service) {
5305
5305
  );
5306
5306
  server.tool(
5307
5307
  "get_mcp_integration",
5308
- "Retrieve detailed information about a specific MCP integration by ID or slug. Returns full integration config including auth type, transport, and configuration keys (header values are masked). Use to inspect Portkey-side connection details. Differs from get_mcp_integration_metadata which returns the external server's self-reported info.",
5308
+ "Retrieve one MCP integration by id or slug. Returns the full Portkey-side config, including auth type, transport, and masked configuration keys; use get_mcp_integration_metadata for the server's self-reported metadata.",
5309
5309
  MCP_INTEGRATIONS_TOOL_SCHEMAS.getMcpIntegration,
5310
5310
  async (params) => {
5311
5311
  const integration = await service.mcpIntegrations.getMcpIntegration(
@@ -5323,7 +5323,7 @@ function registerMcpIntegrationsTools(server, service) {
5323
5323
  );
5324
5324
  server.tool(
5325
5325
  "update_mcp_integration",
5326
- "Update an existing MCP integration's name, description, URL, auth, or transport. Changing url or auth_type may break active connections. Changes take effect immediately for all connected users.",
5326
+ "Update an MCP integration's name, description, URL, auth, or transport. Changes apply immediately and altering url or auth_type can break connected clients; use update_mcp_server when you only need to rename or re-describe a server.",
5327
5327
  MCP_INTEGRATIONS_TOOL_SCHEMAS.updateMcpIntegration,
5328
5328
  async (params) => {
5329
5329
  const { id, custom_headers, ...rest } = params;
@@ -5350,7 +5350,7 @@ function registerMcpIntegrationsTools(server, service) {
5350
5350
  );
5351
5351
  server.tool(
5352
5352
  "delete_mcp_integration",
5353
- "Delete an MCP integration permanently. Also removes all MCP servers under this integration. Connected users will lose access immediately. This action cannot be undone.",
5353
+ "Delete an MCP integration and all servers beneath it. This is irreversible, removes connected access immediately, and should only be used after confirming nothing depends on the integration.",
5354
5354
  MCP_INTEGRATIONS_TOOL_SCHEMAS.deleteMcpIntegration,
5355
5355
  async (params) => {
5356
5356
  await service.mcpIntegrations.deleteMcpIntegration(params.id);
@@ -5373,7 +5373,7 @@ function registerMcpIntegrationsTools(server, service) {
5373
5373
  );
5374
5374
  server.tool(
5375
5375
  "get_mcp_integration_metadata",
5376
- "Retrieve server-reported metadata for an MCP integration including name, version, protocol, and sync status. Use to verify the external server is responding and check its capabilities. Differs from get_mcp_integration which shows Portkey-side config.",
5376
+ "Retrieve the external MCP server's self-reported metadata for an integration. Returns name, version, protocol, capability flags, and sync status; use get_mcp_integration for the Portkey-side connection config.",
5377
5377
  MCP_INTEGRATIONS_TOOL_SCHEMAS.getMcpIntegrationMetadata,
5378
5378
  async (params) => {
5379
5379
  const metadata = await service.mcpIntegrations.getMcpIntegrationMetadata(
@@ -5395,7 +5395,7 @@ function registerMcpIntegrationsTools(server, service) {
5395
5395
  );
5396
5396
  server.tool(
5397
5397
  "list_mcp_integration_capabilities",
5398
- "List all capabilities (tools, resources, prompts) the external MCP server exposes on an integration. Use before update_mcp_integration_capabilities to see what can be enabled or disabled. Returns total count and array of capabilities with their enabled status.",
5398
+ "List capabilities exposed by the external MCP server for an integration. Returns total plus enabled-state entries so you can decide what to toggle; use before update_mcp_integration_capabilities when you need to compare the current surface.",
5399
5399
  MCP_INTEGRATIONS_TOOL_SCHEMAS.listMcpIntegrationCapabilities,
5400
5400
  async (params) => {
5401
5401
  const result = await service.mcpIntegrations.listMcpIntegrationCapabilities(params.id);
@@ -5415,7 +5415,7 @@ function registerMcpIntegrationsTools(server, service) {
5415
5415
  );
5416
5416
  server.tool(
5417
5417
  "update_mcp_integration_capabilities",
5418
- "Bulk enable or disable capabilities on an MCP integration to control which MCP tools, resources, and prompts are available to users. Disabled capabilities are hidden from connected clients. Changes take effect immediately.",
5418
+ "Bulk enable or disable capabilities on an MCP integration. Changes take effect immediately for connected users and hide or expose the selected tools, resources, and prompts; use list_mcp_integration_capabilities first if you need the current state.",
5419
5419
  MCP_INTEGRATIONS_TOOL_SCHEMAS.updateMcpIntegrationCapabilities,
5420
5420
  async (params) => {
5421
5421
  await service.mcpIntegrations.updateMcpIntegrationCapabilities(
@@ -5443,7 +5443,7 @@ function registerMcpIntegrationsTools(server, service) {
5443
5443
  );
5444
5444
  server.tool(
5445
5445
  "list_mcp_integration_workspaces",
5446
- "List which workspaces have access to an MCP integration. Returns global access setting and per-workspace enabled status. Use to audit access before modifying permissions with update_mcp_integration_workspaces.",
5446
+ "List which workspaces can access an MCP integration. Returns the global access mode plus per-workspace enablement for audit or permission review; use before update_mcp_integration_workspaces.",
5447
5447
  MCP_INTEGRATIONS_TOOL_SCHEMAS.listMcpIntegrationWorkspaces,
5448
5448
  async (params) => {
5449
5449
  const result = await service.mcpIntegrations.listMcpIntegrationWorkspaces(
@@ -5471,7 +5471,7 @@ function registerMcpIntegrationsTools(server, service) {
5471
5471
  );
5472
5472
  server.tool(
5473
5473
  "update_mcp_integration_workspaces",
5474
- "Grant or revoke workspace access to an MCP integration in bulk. Changes affect all users in the workspace immediately. Use list_mcp_integration_workspaces first to see current access state.",
5474
+ "Grant or revoke workspace access to an MCP integration in bulk. Changes take effect immediately for all users in the selected workspaces; use list_mcp_integration_workspaces first to review the current access state.",
5475
5475
  MCP_INTEGRATIONS_TOOL_SCHEMAS.updateMcpIntegrationWorkspaces,
5476
5476
  async (params) => {
5477
5477
  await service.mcpIntegrations.updateMcpIntegrationWorkspaces(params.id, {
@@ -5586,7 +5586,7 @@ function formatMcpServerUserAccess(user) {
5586
5586
  function registerMcpServersTools(server, service) {
5587
5587
  server.tool(
5588
5588
  "list_mcp_servers",
5589
- "List all MCP servers in your Portkey organization with optional pagination and workspace filtering. MCP servers are instances under MCP integrations. Use to discover server IDs needed by other tools. Differs from list_mcp_integrations which shows the parent integration connections. Returns paginated array of servers with total count.",
5589
+ "List MCP servers in the organization. Returns paginated server records plus total for discovering server IDs; use get_mcp_server for one server's details and list_mcp_integrations for the parent integration.",
5590
5590
  MCP_SERVERS_TOOL_SCHEMAS.listMcpServers,
5591
5591
  async (params) => {
5592
5592
  const result = await service.mcpServers.listMcpServers(params);
@@ -5609,7 +5609,7 @@ function registerMcpServersTools(server, service) {
5609
5609
  );
5610
5610
  server.tool(
5611
5611
  "create_mcp_server",
5612
- "Register a new MCP server instance under an existing MCP integration. Use list_mcp_integrations to find the mcp_integration_id first. Returns the new server's id and slug.",
5612
+ "Create an MCP server under an existing integration. Registers the server and returns the new id and slug; use list_mcp_integrations first to find the parent integration, then capabilities or access tools to configure it.",
5613
5613
  MCP_SERVERS_TOOL_SCHEMAS.createMcpServer,
5614
5614
  async (params) => {
5615
5615
  const result = await service.mcpServers.createMcpServer(params);
@@ -5633,7 +5633,7 @@ function registerMcpServersTools(server, service) {
5633
5633
  );
5634
5634
  server.tool(
5635
5635
  "get_mcp_server",
5636
- "Retrieve detailed information about a specific MCP server by ID or slug. Returns server details including linked integration ID and status. Use to check server configuration and health.",
5636
+ "Retrieve one MCP server by id or slug. Returns server details including the parent integration, status, and created time; use get_mcp_server when you need the server record rather than the integration config.",
5637
5637
  MCP_SERVERS_TOOL_SCHEMAS.getMcpServer,
5638
5638
  async (params) => {
5639
5639
  const mcpServer = await service.mcpServers.getMcpServer(params.id);
@@ -5649,7 +5649,7 @@ function registerMcpServersTools(server, service) {
5649
5649
  );
5650
5650
  server.tool(
5651
5651
  "update_mcp_server",
5652
- "Update an existing MCP server's name or description. Only name and description can be changed on a server. To change the URL or auth configuration, update the parent MCP integration instead.",
5652
+ "Update an MCP server's name or description. Changes apply immediately, but URL and auth live on the parent integration, so use update_mcp_integration for those fields.",
5653
5653
  MCP_SERVERS_TOOL_SCHEMAS.updateMcpServer,
5654
5654
  async (params) => {
5655
5655
  const { id, ...data } = params;
@@ -5673,7 +5673,7 @@ function registerMcpServersTools(server, service) {
5673
5673
  );
5674
5674
  server.tool(
5675
5675
  "delete_mcp_server",
5676
- "Delete an MCP server instance by ID. This action cannot be undone. Connected users and workspaces lose access immediately, and workspace access grants to this server are removed. Verify no active integrations depend on it before deleting.",
5676
+ "Delete an MCP server instance. This is irreversible, removes connected users' access immediately, and should be used only after confirming no workflows depend on the server.",
5677
5677
  MCP_SERVERS_TOOL_SCHEMAS.deleteMcpServer,
5678
5678
  async (params) => {
5679
5679
  await service.mcpServers.deleteMcpServer(params.id);
@@ -5696,7 +5696,7 @@ function registerMcpServersTools(server, service) {
5696
5696
  );
5697
5697
  server.tool(
5698
5698
  "test_mcp_server",
5699
- "Send a connectivity check to an MCP server to verify it is reachable and responding. Returns success/failure, response time in ms, and any error message. Use to diagnose connection issues before investigating configuration.",
5699
+ "Test connectivity to an MCP server. Sends a live check and returns success, response time, HTTP status, and any error; use this before changing configuration or when diagnosing reachability.",
5700
5700
  MCP_SERVERS_TOOL_SCHEMAS.testMcpServer,
5701
5701
  async (params) => {
5702
5702
  const result = await service.mcpServers.testMcpServer(params.id);
@@ -5712,7 +5712,7 @@ function registerMcpServersTools(server, service) {
5712
5712
  );
5713
5713
  server.tool(
5714
5714
  "list_mcp_server_capabilities",
5715
- "List all capabilities (tools, resources, prompts) exposed by an MCP server instance. Differs from list_mcp_integration_capabilities which shows integration-level capability settings. Returns total count and array of capabilities.",
5715
+ "List capabilities exposed by an MCP server instance. Returns total plus the current tool, resource, and prompt surface; use this instead of the integration-level capability list when you need server-specific exposure.",
5716
5716
  MCP_SERVERS_TOOL_SCHEMAS.listMcpServerCapabilities,
5717
5717
  async (params) => {
5718
5718
  const result = await service.mcpServers.listMcpServerCapabilities(
@@ -5734,7 +5734,7 @@ function registerMcpServersTools(server, service) {
5734
5734
  );
5735
5735
  server.tool(
5736
5736
  "update_mcp_server_capabilities",
5737
- "Enable or disable specific capabilities on an MCP server instance. Overrides integration-level capability settings for this server. Changes take effect immediately for connected users.",
5737
+ "Enable or disable capabilities on an MCP server. Changes take effect immediately and override the integration-level settings for this server; use list_mcp_server_capabilities first to inspect the current surface.",
5738
5738
  MCP_SERVERS_TOOL_SCHEMAS.updateMcpServerCapabilities,
5739
5739
  async (params) => {
5740
5740
  await service.mcpServers.updateMcpServerCapabilities(params.id, {
@@ -5759,7 +5759,7 @@ function registerMcpServersTools(server, service) {
5759
5759
  );
5760
5760
  server.tool(
5761
5761
  "list_mcp_server_user_access",
5762
- "List per-user access settings for an MCP server including override flags and connection status. Returns default_user_access setting and array of users. Use to audit who can access this server before modifying permissions.",
5762
+ "List per-user access for an MCP server. Returns the default access mode, override flags, and connection status so you can audit who can use it; use before update_mcp_server_user_access.",
5763
5763
  MCP_SERVERS_TOOL_SCHEMAS.listMcpServerUserAccess,
5764
5764
  async (params) => {
5765
5765
  const result = await service.mcpServers.listMcpServerUserAccess(
@@ -5785,7 +5785,7 @@ function registerMcpServersTools(server, service) {
5785
5785
  );
5786
5786
  server.tool(
5787
5787
  "update_mcp_server_user_access",
5788
- "Grant or revoke individual user access to an MCP server. Overrides the default_user_access setting for specified users. Changes take effect immediately.",
5788
+ "Grant or revoke individual user access to an MCP server. Changes take effect immediately and override the default access setting for the selected users; use list_mcp_server_user_access first if you need the current state.",
5789
5789
  MCP_SERVERS_TOOL_SCHEMAS.updateMcpServerUserAccess,
5790
5790
  async (params) => {
5791
5791
  await service.mcpServers.updateMcpServerUserAccess(params.id, {
@@ -5850,7 +5850,7 @@ var PARTIALS_TOOL_SCHEMAS = {
5850
5850
  function registerPartialsTools(server, service) {
5851
5851
  server.tool(
5852
5852
  "create_prompt_partial",
5853
- "Create a new prompt partial (reusable text snippet) that can be included in prompts using mustache syntax like {{> partial_name}}. After creation, use publish_partial to make it the default version. Returns id, slug, and version_id.",
5853
+ "Create a reusable prompt partial for inclusion with {{> partial_name}}. Use this for shared snippets or macros; returns the partial id, slug, and version id, and the new version stays inactive until published.",
5854
5854
  PARTIALS_TOOL_SCHEMAS.createPromptPartial,
5855
5855
  async (params) => {
5856
5856
  const result = await service.partials.createPromptPartial({
@@ -5880,7 +5880,7 @@ function registerPartialsTools(server, service) {
5880
5880
  );
5881
5881
  server.tool(
5882
5882
  "list_prompt_partials",
5883
- "List all prompt partials in your Portkey organization with optional filtering by collection. Returns all partials with id, slug, name, and status. Use to discover partial IDs or check if a partial already exists before creating.",
5883
+ "List partials across collections, with optional collection filtering. Returns ids, slugs, names, collections, and status so you can choose a prompt_partial_id before get/update/delete.",
5884
5884
  PARTIALS_TOOL_SCHEMAS.listPromptPartials,
5885
5885
  async (params) => {
5886
5886
  const partials = await service.partials.listPromptPartials(params);
@@ -5911,7 +5911,7 @@ function registerPartialsTools(server, service) {
5911
5911
  );
5912
5912
  server.tool(
5913
5913
  "get_prompt_partial",
5914
- "Retrieve detailed information about a specific prompt partial. Returns the partial's content string and current version info. Use to inspect content before including it in a prompt via {{> partial_name}}.",
5914
+ "Fetch a partial's content and current version details. Use this before embedding, updating, or checking what {{> partial_name}} resolves to; returns the stored string plus version metadata.",
5915
5915
  PARTIALS_TOOL_SCHEMAS.getPromptPartial,
5916
5916
  async (params) => {
5917
5917
  const partial = await service.partials.getPromptPartial(
@@ -5945,7 +5945,7 @@ function registerPartialsTools(server, service) {
5945
5945
  );
5946
5946
  server.tool(
5947
5947
  "update_prompt_partial",
5948
- "Update an existing prompt partial. A new version is created in archived status \u2014 use publish_partial to make it active.",
5948
+ "Create a new version of a partial by updating its content or metadata. Only provided fields change, and the new version stays inactive until publish_partial makes it current.",
5949
5949
  PARTIALS_TOOL_SCHEMAS.updatePromptPartial,
5950
5950
  async (params) => {
5951
5951
  const { prompt_partial_id, ...updateData } = params;
@@ -5972,7 +5972,7 @@ function registerPartialsTools(server, service) {
5972
5972
  );
5973
5973
  server.tool(
5974
5974
  "delete_prompt_partial",
5975
- "Delete a prompt partial by ID. This action cannot be undone. Prompts referencing this partial via {{> name}} will fail to render. Ensure no active prompts depend on it.",
5975
+ "Delete a prompt partial by ID. This cannot be undone, and prompts that reference it with {{> name}} will fail to render until you replace the reference.",
5976
5976
  PARTIALS_TOOL_SCHEMAS.deletePromptPartial,
5977
5977
  async (params) => {
5978
5978
  await service.partials.deletePromptPartial(params.prompt_partial_id);
@@ -5995,7 +5995,7 @@ function registerPartialsTools(server, service) {
5995
5995
  );
5996
5996
  server.tool(
5997
5997
  "list_partial_versions",
5998
- "List all versions of a prompt partial to view its change history. Returns all versions with content preview. Use to find a version number before calling publish_partial to roll back or promote a version.",
5998
+ "List all versions for one partial, including version numbers, descriptions, status, and timestamps. Use this when you need history or want to choose a version_id before publish_partial.",
5999
5999
  PARTIALS_TOOL_SCHEMAS.listPartialVersions,
6000
6000
  async (params) => {
6001
6001
  const versions = await service.partials.listPartialVersions(
@@ -6030,7 +6030,7 @@ function registerPartialsTools(server, service) {
6030
6030
  );
6031
6031
  server.tool(
6032
6032
  "publish_partial",
6033
- "Publish a specific version of a prompt partial, making it the default version. After publishing, all prompts using {{> partial_name}} will resolve to this version's content.",
6033
+ "Publish a specific partial version as the default version. This changes which content {{> partial_name}} resolves to and replaces the previously active version.",
6034
6034
  PARTIALS_TOOL_SCHEMAS.publishPartial,
6035
6035
  async (params) => {
6036
6036
  await service.partials.publishPartial(params.prompt_partial_id, {
@@ -6355,14 +6355,7 @@ function formatPromptListResponse(prompts, params) {
6355
6355
  function registerPromptsTools(server, service) {
6356
6356
  server.tool(
6357
6357
  "create_prompt",
6358
- `Create a new prompt template in Portkey. Supports both the legacy string template and a structured messages alias for chat prompts.
6359
-
6360
- IMPORTANT: The "string" parameter accepts TWO legacy formats:
6361
- 1. Plain text: "Hello {{name}}, how can I help?"
6362
- 2. Multi-message JSON array (MUST be a JSON-encoded string):
6363
- '[{"role":"system","content":[{"type":"text","text":"You are a helpful assistant."}]},{"role":"user","content":[{"type":"text","text":"{{user_input}}"}]}]'
6364
-
6365
- For structured prompts, prefer the "messages" alias and let the server serialize it to the legacy string format.`,
6358
+ "Create a new prompt template and initial version. Use this for first-time setup; use migrate_prompt for idempotent CI/CD flows. Accepts plain text or structured chat messages, creates a new version immediately, and returns the prompt id, slug, and version id. For multi-message chat prompts pass messages (preferred) or a JSON-encoded array as string.",
6366
6359
  PROMPTS_TOOL_SCHEMAS.createPrompt,
6367
6360
  async (params) => {
6368
6361
  if (!params.model && !params.ai_model_id && !params.finetune_id) {
@@ -6449,7 +6442,7 @@ For structured prompts, prefer the "messages" alias and let the server serialize
6449
6442
  );
6450
6443
  server.tool(
6451
6444
  "list_prompts",
6452
- "List all prompts in your Portkey organization with optional filtering by collection, workspace, or search query. Returns paginated results with id, name, slug, model, and status. Use collection_id to filter by app. Use to discover prompt_id values before calling get_prompt.",
6445
+ "List prompts across the workspace, with optional collection, workspace, or search filters. Returns a paginated summary with id, name, slug, model, and status so you can choose a prompt_id before get_prompt, update_prompt, or render_prompt.",
6453
6446
  PROMPTS_TOOL_SCHEMAS.listPrompts,
6454
6447
  async (params) => {
6455
6448
  const prompts = await service.prompts.listPrompts(params);
@@ -6469,12 +6462,7 @@ For structured prompts, prefer the "messages" alias and let the server serialize
6469
6462
  );
6470
6463
  server.tool(
6471
6464
  "get_prompt",
6472
- `Retrieve detailed information about a specific prompt including its template, parameters, and version history.
6473
-
6474
- The template field shows the raw "string" value stored in Portkey:
6475
- - If it starts with "[", it is a JSON-encoded messages array (multi-message prompt with roles).
6476
- - Otherwise it is a plain string template.
6477
- When updating a prompt, pass the same format back in the "string" field of update_prompt.`,
6465
+ "Fetch a prompt's full definition, active version, and version history. Use this before updating, publishing, rendering, or copying a prompt when you need the stored template and metadata. For multi-message chat prompts pass messages (preferred) or a JSON-encoded array as string.",
6478
6466
  PROMPTS_TOOL_SCHEMAS.getPrompt,
6479
6467
  async (params) => {
6480
6468
  const prompt = await service.prompts.getPrompt(params.prompt_id);
@@ -6536,14 +6524,7 @@ When updating a prompt, pass the same format back in the "string" field of updat
6536
6524
  );
6537
6525
  server.tool(
6538
6526
  "update_prompt",
6539
- `Update an existing prompt template. Creates a new version. Uses patch mode \u2014 only provided fields are updated, others are kept from the current version.
6540
-
6541
- IMPORTANT: The legacy "string" parameter accepts the same two formats as create_prompt:
6542
- 1. Plain text: "Hello {{name}}"
6543
- 2. Multi-message JSON array (MUST be a JSON-encoded string):
6544
- '[{"role":"system","content":[{"type":"text","text":"..."}]},{"role":"user","content":[{"type":"text","text":"{{input}}"}]}]'
6545
-
6546
- For structured chat prompts, prefer the "messages" alias and let the server serialize it for you. New versions are created in "archived" status \u2014 use publish_prompt to make active.`,
6527
+ "Update an existing prompt and create a new archived version. Only provided fields change, and publish_prompt is what makes the new version active. For multi-message chat prompts pass messages (preferred) or a JSON-encoded array as string.",
6547
6528
  PROMPTS_TOOL_SCHEMAS.updatePrompt,
6548
6529
  async (params) => {
6549
6530
  const { prompt_id, dry_run, messages, ...updateData } = params;
@@ -6608,7 +6589,7 @@ For structured chat prompts, prefer the "messages" alias and let the server seri
6608
6589
  );
6609
6590
  server.tool(
6610
6591
  "delete_prompt",
6611
- "Delete a prompt and all its versions by ID. This action cannot be undone. Applications calling this prompt slug will fail immediately. Use list_prompt_versions first to review history; consider archiving via update_prompt status instead if an audit trail is needed.",
6592
+ "Delete a prompt and all its versions by id. This cannot be undone, immediately breaks callers using the slug, and should only be used after checking list_prompt_versions or confirming you do not need an audit trail.",
6612
6593
  PROMPTS_TOOL_SCHEMAS.deletePrompt,
6613
6594
  async (params) => {
6614
6595
  await service.prompts.deletePrompt(params.prompt_id);
@@ -6631,7 +6612,7 @@ For structured chat prompts, prefer the "messages" alias and let the server seri
6631
6612
  );
6632
6613
  server.tool(
6633
6614
  "publish_prompt",
6634
- "Publish a specific version of a prompt, making it the default version that will be used when the prompt is called. This is useful for promoting a tested version to production.",
6615
+ "Publish a specific version of a prompt as the active default. Use list_prompt_versions to choose the version and update_prompt when you need to create new content before promoting it.",
6635
6616
  PROMPTS_TOOL_SCHEMAS.publishPrompt,
6636
6617
  async (params) => {
6637
6618
  await service.prompts.publishPrompt(params.prompt_id, {
@@ -6658,7 +6639,7 @@ For structured chat prompts, prefer the "messages" alias and let the server seri
6658
6639
  );
6659
6640
  server.tool(
6660
6641
  "list_prompt_versions",
6661
- "List all versions of a specific prompt with their details, including version number, description, template content, and creation date.",
6642
+ "List all versions of one prompt, including version number, description, status, label, and a short template preview. Use this for history or to choose a version_id before publish_prompt or update_prompt_version.",
6662
6643
  PROMPTS_TOOL_SCHEMAS.listPromptVersions,
6663
6644
  async (params) => {
6664
6645
  const versions = await service.prompts.listPromptVersions(
@@ -6696,7 +6677,7 @@ For structured chat prompts, prefer the "messages" alias and let the server seri
6696
6677
  );
6697
6678
  server.tool(
6698
6679
  "render_prompt",
6699
- "Render a prompt template by substituting variables, returning the final messages without executing. Previews the final messages after variable substitution without sending to the AI model. Use to verify template output before running a completion. Differs from run_prompt_completion which actually calls the model.",
6680
+ "Render a prompt by substituting variables and returning the final messages without calling the model. Use this to verify template output before a completion; run_prompt_completion is the tool that actually invokes the model.",
6700
6681
  PROMPTS_TOOL_SCHEMAS.renderPrompt,
6701
6682
  async (params) => {
6702
6683
  const result = await service.prompts.renderPrompt(params.prompt_id, {
@@ -6728,7 +6709,7 @@ For structured chat prompts, prefer the "messages" alias and let the server seri
6728
6709
  );
6729
6710
  server.tool(
6730
6711
  "run_prompt_completion",
6731
- "Execute a prompt template against the configured AI model and return the model's response. Costs money \u2014 use render_prompt to preview first. REQUIRES billing metadata (client_id, app, env). Use validate_completion_metadata first if uncertain.",
6712
+ "Execute a prompt against the configured model and return the completion. This makes a billable model call, so use render_prompt first when you want to check the template and validate_completion_metadata when billing fields are uncertain.",
6732
6713
  PROMPTS_TOOL_SCHEMAS.runPromptCompletion,
6733
6714
  async (params) => {
6734
6715
  const result = await service.prompts.runPromptCompletion(
@@ -6767,7 +6748,7 @@ For structured chat prompts, prefer the "messages" alias and let the server seri
6767
6748
  );
6768
6749
  server.tool(
6769
6750
  "migrate_prompt",
6770
- "Create or update a prompt based on whether it exists. Useful for CI/CD and prompt-as-code workflows. Finds existing prompts by name within the collection. The app and env values are added to template_metadata automatically. For structured chat prompts, prefer the messages alias instead of hand-encoding JSON into string.",
6751
+ "Create or update a prompt in one idempotent step for CI/CD and prompt-as-code flows. Finds existing prompts by name within the collection, stores app/env in template_metadata, and supports dry_run for safe preflight checks.",
6771
6752
  PROMPTS_TOOL_SCHEMAS.migratePrompt,
6772
6753
  async (params) => {
6773
6754
  const templateString = normalizePromptTemplateString(params);
@@ -6821,7 +6802,7 @@ For structured chat prompts, prefer the "messages" alias and let the server seri
6821
6802
  );
6822
6803
  server.tool(
6823
6804
  "promote_prompt",
6824
- "Promote a prompt from one environment to another (e.g., staging -> prod). Copies the current version to the target environment. If the target prompt already exists it is updated with a new version; otherwise a new prompt is created.",
6805
+ "Copy a prompt from one environment to another and create or update the target automatically. Use this for staged releases when you want the target prompt synchronized without manual edits, and it returns both source and target version ids.",
6825
6806
  PROMPTS_TOOL_SCHEMAS.promotePrompt,
6826
6807
  async (params) => {
6827
6808
  const result = await service.prompts.promotePrompt({
@@ -6859,7 +6840,7 @@ For structured chat prompts, prefer the "messages" alias and let the server seri
6859
6840
  );
6860
6841
  server.tool(
6861
6842
  "validate_completion_metadata",
6862
- "Validate billing metadata before running a completion. Checks for required fields (client_id, app, env) and valid values. Call this before run_prompt_completion to catch missing or invalid billing fields. Does not make any changes.",
6843
+ "Preflight billing metadata before run_prompt_completion. Validates required fields and values without making changes, so you can catch attribution errors before paying for the call.",
6863
6844
  PROMPTS_TOOL_SCHEMAS.validateCompletionMetadata,
6864
6845
  async (params) => {
6865
6846
  const result = service.prompts.validateBillingMetadata(params);
@@ -6884,7 +6865,7 @@ For structured chat prompts, prefer the "messages" alias and let the server seri
6884
6865
  );
6885
6866
  server.tool(
6886
6867
  "get_prompt_version",
6887
- "Retrieve a specific version of a prompt by its version UUID. Use list_prompt_versions to find version IDs. Returns full template, parameters, and model config for that version.",
6868
+ "Retrieve a specific prompt version by its version UUID. Use list_prompt_versions to find the id first; returns the template, parameters, and model config for that version.",
6888
6869
  PROMPTS_TOOL_SCHEMAS.getPromptVersion,
6889
6870
  async (params) => {
6890
6871
  const version = await service.prompts.getPromptVersion(
@@ -6903,7 +6884,7 @@ For structured chat prompts, prefer the "messages" alias and let the server seri
6903
6884
  );
6904
6885
  server.tool(
6905
6886
  "update_prompt_version",
6906
- "Update a specific prompt version. Currently only supports assigning or removing a label. Use list_prompt_labels to find label IDs. Pass null to remove the current label.",
6887
+ "Update a specific prompt version's label assignment. This only assigns or removes a label, and null clears the label after you look up ids with list_prompt_labels.",
6907
6888
  PROMPTS_TOOL_SCHEMAS.updatePromptVersion,
6908
6889
  async (params) => {
6909
6890
  if (params.label_id === void 0) {
@@ -7011,7 +6992,7 @@ var PROVIDERS_TOOL_SCHEMAS = {
7011
6992
  function registerProvidersTools(server, service) {
7012
6993
  server.tool(
7013
6994
  "list_providers",
7014
- "List workspace-scoped providers, which are instances of org-level integrations with their own usage and rate limits. Differs from list_integrations which shows org-level provider connections. Use to discover provider slugs for a workspace. Returns name, slug, limits, and status per provider.",
6995
+ "List workspace-scoped provider instances and their limits or status. Use this to find provider slugs for workspace-level updates; use list_integrations for the org-level source connection. Returns total plus provider name, slug, integration, status, limits, expiration, and reset flags.",
7015
6996
  PROVIDERS_TOOL_SCHEMAS.listProviders,
7016
6997
  async (params) => {
7017
6998
  const providers = await service.providers.listProviders({
@@ -7057,7 +7038,7 @@ function registerProvidersTools(server, service) {
7057
7038
  );
7058
7039
  server.tool(
7059
7040
  "create_provider",
7060
- "Create a workspace-scoped provider linked to an org-level integration. Use list_integrations to find the integration_id first. Providers inherit the integration's API key but can have independent usage limits, rate limits, and expiration. Returns the new provider's id and slug.",
7041
+ "Create a workspace provider backed by an org integration. The provider inherits the integration key, but its limits and expiration are enforced independently for that workspace. Returns the new provider id and slug.",
7061
7042
  PROVIDERS_TOOL_SCHEMAS.createProvider,
7062
7043
  async (params) => {
7063
7044
  const result = await service.providers.createProvider({
@@ -7098,7 +7079,7 @@ function registerProvidersTools(server, service) {
7098
7079
  );
7099
7080
  server.tool(
7100
7081
  "get_provider",
7101
- "Retrieve full provider details by slug, including usage limits, rate limits, and expiration. Use to check current consumption against limits or inspect provider configuration before updating.",
7082
+ "Fetch one provider by slug, including limits, rate settings, expiration, and reset status. Use this to check consumption or audit configuration before updating.",
7102
7083
  PROVIDERS_TOOL_SCHEMAS.getProvider,
7103
7084
  async (params) => {
7104
7085
  const provider = await service.providers.getProvider(
@@ -7140,7 +7121,7 @@ function registerProvidersTools(server, service) {
7140
7121
  );
7141
7122
  server.tool(
7142
7123
  "update_provider",
7143
- "Update a provider's name, note, usage limits, rate limits, or expiration. Set reset_usage to true to clear accumulated usage counters without changing the limit. Returns the updated provider's id and slug.",
7124
+ "Update a provider's metadata, limits, or expiration. reset_usage clears accumulated usage counters immediately, so use it only when you intend to reset quota tracking. Returns the updated provider id and slug.",
7144
7125
  PROVIDERS_TOOL_SCHEMAS.updateProvider,
7145
7126
  async (params) => {
7146
7127
  const result = await service.providers.updateProvider(
@@ -7183,7 +7164,7 @@ function registerProvidersTools(server, service) {
7183
7164
  );
7184
7165
  server.tool(
7185
7166
  "delete_provider",
7186
- "Delete a workspace-level provider by slug. This action cannot be undone. Virtual keys, configs, and prompts referencing this provider will stop working. Audit dependent resources first; use delete_integration for org-level provider connections instead.",
7167
+ "Delete a workspace provider by slug. This is irreversible and will break prompts, configs, and virtual keys that reference it; use delete_integration for the org source instead. Returns success after the provider is removed.",
7187
7168
  PROVIDERS_TOOL_SCHEMAS.deleteProvider,
7188
7169
  async (params) => {
7189
7170
  await service.providers.deleteProvider(params.slug, params.workspace_id);
@@ -7235,7 +7216,7 @@ var TRACING_TOOL_SCHEMAS = {
7235
7216
  function registerTracingTools(server, service) {
7236
7217
  server.tool(
7237
7218
  "create_feedback",
7238
- "Create feedback for a specific trace/request. Use this to capture user feedback (thumbs up/down, ratings) on AI generations. Feedback is linked via trace_id and can include custom metadata for analysis. Trace IDs are surfaced in request logs and via log exports (create_log_export).",
7219
+ "Create feedback for a trace or request. Writes a new feedback record linked by trace_id, returns the created feedback IDs and status, and takes effect immediately; use update_feedback when correcting an existing record.",
7239
7220
  TRACING_TOOL_SCHEMAS.createFeedback,
7240
7221
  async (params) => {
7241
7222
  const result = await service.tracing.createFeedback({
@@ -7264,7 +7245,7 @@ function registerTracingTools(server, service) {
7264
7245
  );
7265
7246
  server.tool(
7266
7247
  "update_feedback",
7267
- "Update existing feedback by ID. Use this instead of create_feedback when feedback already exists and needs correction or refinement. Only value, weight, and metadata can be changed; the trace_id association is immutable. Returns the updated feedback status and IDs.",
7248
+ "Update an existing feedback record by ID. Returns the updated status and feedback IDs, changes only value, weight, and metadata, and leaves the trace linkage immutable; use create_feedback only for a new record.",
7268
7249
  TRACING_TOOL_SCHEMAS.updateFeedback,
7269
7250
  async (params) => {
7270
7251
  const result = await service.tracing.updateFeedback(params.id, {
@@ -7393,7 +7374,7 @@ function formatUserAnalyticsGroup(group) {
7393
7374
  function registerUsersTools(server, service) {
7394
7375
  server.tool(
7395
7376
  "list_all_users",
7396
- "List all users in your Portkey organization. Returns each user's ID, name, email, role, and timestamps. Use this for browsing or auditing the full member list; use get_user to fetch a single user by ID.",
7377
+ "List accepted org users with id, name, email, role, and timestamps. Use this to find a user_id before get_user, update_user, delete_user, or add_workspace_member; use list_user_invites for pending invitations.",
7397
7378
  USERS_TOOL_SCHEMAS.listAllUsers,
7398
7379
  async () => {
7399
7380
  const users = await service.users.listUsers();
@@ -7416,7 +7397,7 @@ function registerUsersTools(server, service) {
7416
7397
  );
7417
7398
  server.tool(
7418
7399
  "invite_user",
7419
- "Invite a new user to your Portkey organization with specific workspace access and API key permissions. After the invite is accepted, use add_workspace_member to assign workspace roles.",
7400
+ "Invite a new org user and optionally provision workspace access and an API key in one call. Workspace assignments apply only after acceptance; use add_workspace_member or update_workspace_member later for follow-up changes.",
7420
7401
  USERS_TOOL_SCHEMAS.inviteUser,
7421
7402
  async (params) => {
7422
7403
  const result = await service.users.inviteUser(params);
@@ -7440,7 +7421,7 @@ function registerUsersTools(server, service) {
7440
7421
  );
7441
7422
  server.tool(
7442
7423
  "get_user_stats",
7443
- "Retrieve per-user request count and cost analytics for a required time range (time_of_generation_min/max). Unlike get_users_analytics which tracks active/new user counts over time, this returns usage-based stats grouped by user. Supports filtering by cost, tokens, status codes, and virtual keys.",
7424
+ "Return per-user request and cost analytics for a required time range. This is usage-by-user, not population metrics; use get_users_analytics for active-user or cohort trends.",
7444
7425
  USERS_TOOL_SCHEMAS.getUserStats,
7445
7426
  async (params) => {
7446
7427
  const stats = await service.users.getUserGroupedData(params);
@@ -7463,7 +7444,7 @@ function registerUsersTools(server, service) {
7463
7444
  );
7464
7445
  server.tool(
7465
7446
  "get_user",
7466
- "Retrieve a single user's profile by their ID. Returns ID, name, email, role, and timestamps. Use this when you already have a user ID; use list_all_users to browse or search all organization members.",
7447
+ "Get one accepted user by id and return their profile, role, and timestamps. Use list_all_users to find the id if you only have a name or email, and get_user_invite for pending invitations.",
7467
7448
  USERS_TOOL_SCHEMAS.getUser,
7468
7449
  async (params) => {
7469
7450
  const user = await service.users.getUser(params.user_id);
@@ -7479,7 +7460,7 @@ function registerUsersTools(server, service) {
7479
7460
  );
7480
7461
  server.tool(
7481
7462
  "update_user",
7482
- "Update a user's first name, last name, or organization role (admin/member). Cannot change the user's email address or workspace-level roles; use update_workspace_member for workspace roles.",
7463
+ "Update a user's first name, last name, or organization role by id. Email and workspace roles are not editable here; use update_workspace_member for workspace membership changes.",
7483
7464
  USERS_TOOL_SCHEMAS.updateUser,
7484
7465
  async (params) => {
7485
7466
  const { user_id, ...updateData } = params;
@@ -7503,7 +7484,7 @@ function registerUsersTools(server, service) {
7503
7484
  );
7504
7485
  server.tool(
7505
7486
  "delete_user",
7506
- "Remove a user from your Portkey organization by ID. This action cannot be undone. Permanently removes org and workspace memberships and revokes the user's API keys; active sessions will fail immediately. Use delete_user_invite for pending invitations instead.",
7487
+ "Delete a user from the org by id. This is permanent, removes org and workspace memberships, revokes API keys, and ends active sessions; use delete_user_invite for pending invites instead.",
7507
7488
  USERS_TOOL_SCHEMAS.deleteUser,
7508
7489
  async (params) => {
7509
7490
  await service.users.deleteUser(params.user_id);
@@ -7526,7 +7507,7 @@ function registerUsersTools(server, service) {
7526
7507
  );
7527
7508
  server.tool(
7528
7509
  "list_user_invites",
7529
- "List all pending and sent user invitations in your Portkey organization. Returns each invite's ID, email, role, status, and expiry. Use this to check invitation status; use list_all_users for users who have already accepted.",
7510
+ "List pending and sent invitations with id, email, role, status, and expiry. Use this to check invite state; use list_all_users for users who already accepted.",
7530
7511
  USERS_TOOL_SCHEMAS.listUserInvites,
7531
7512
  async () => {
7532
7513
  const invites = await service.users.listUserInvites();
@@ -7549,7 +7530,7 @@ function registerUsersTools(server, service) {
7549
7530
  );
7550
7531
  server.tool(
7551
7532
  "get_user_invite",
7552
- "Retrieve a specific invitation by its invite ID. Returns the invite's email, role, status, creation date, and expiry. This looks up a pending invitation, not an existing user; use get_user for accepted members.",
7533
+ "Get one invitation by invite id and return its email, role, status, and expiry. Use this for pending invites only; use get_user for accepted users.",
7553
7534
  USERS_TOOL_SCHEMAS.getUserInvite,
7554
7535
  async (params) => {
7555
7536
  const invite = await service.users.getUserInvite(params.invite_id);
@@ -7565,7 +7546,7 @@ function registerUsersTools(server, service) {
7565
7546
  );
7566
7547
  server.tool(
7567
7548
  "delete_user_invite",
7568
- "Cancel and permanently delete a pending user invitation. This revokes the invite link so it can no longer be accepted. Does not remove existing users; use delete_user for that.",
7549
+ "Delete a pending invite and revoke its invite link. This does not affect existing users; use delete_user for full user removal.",
7569
7550
  USERS_TOOL_SCHEMAS.deleteUserInvite,
7570
7551
  async (params) => {
7571
7552
  await service.users.deleteUserInvite(params.invite_id);
@@ -7588,7 +7569,7 @@ function registerUsersTools(server, service) {
7588
7569
  );
7589
7570
  server.tool(
7590
7571
  "resend_user_invite",
7591
- "Resend the invitation email for a pending invite that has not yet been accepted. Use when the original email was lost or expired. The invite must still exist; check with get_user_invite first if unsure.",
7572
+ "Resend the email for a pending invite that has not been accepted. The invite must still exist; use get_user_invite first if you are unsure.",
7592
7573
  USERS_TOOL_SCHEMAS.resendUserInvite,
7593
7574
  async (params) => {
7594
7575
  await service.users.resendUserInvite(params.invite_id);
@@ -7718,7 +7699,7 @@ function formatWorkspaceDetail(workspace) {
7718
7699
  function registerWorkspacesTools(server, service) {
7719
7700
  server.tool(
7720
7701
  "list_workspaces",
7721
- "Retrieve a paginated list of all workspaces in your Portkey organization. Returns id, name, slug, and configuration for each workspace. Use this tool first to discover workspace_id values needed by other workspace-scoped operations.",
7702
+ "List workspaces with id, name, slug, default settings, and timestamps. Use this to find a workspace_id before get_workspace, update_workspace, add_workspace_member, or remove_workspace_member.",
7722
7703
  WORKSPACES_TOOL_SCHEMAS.listWorkspaces,
7723
7704
  async (params) => {
7724
7705
  const workspaces = await service.workspaces.listWorkspaces(params);
@@ -7741,7 +7722,7 @@ function registerWorkspacesTools(server, service) {
7741
7722
  );
7742
7723
  server.tool(
7743
7724
  "get_workspace",
7744
- "Retrieve full details for a single workspace by ID, including its configuration, metadata, and complete member list with roles. Unlike list_workspaces, this includes the full user roster \u2014 use it when you need member details or workspace membership counts.",
7725
+ "Get one workspace by id and return its full details, including defaults and the complete member list. Use this when you need membership detail; use list_workspaces for an overview.",
7745
7726
  WORKSPACES_TOOL_SCHEMAS.getWorkspace,
7746
7727
  async (params) => {
7747
7728
  const workspace = await service.workspaces.getWorkspace(
@@ -7759,7 +7740,7 @@ function registerWorkspacesTools(server, service) {
7759
7740
  );
7760
7741
  server.tool(
7761
7742
  "create_workspace",
7762
- "Create a new workspace to isolate resources, API keys, and team members within your Portkey organization. A URL-friendly slug is auto-generated from the name if not provided. Returns the created workspace's id, name, and slug.",
7743
+ "Create a workspace to isolate resources, API keys, and team members. If slug is omitted it is auto-generated from the name; returns the new workspace id, name, and slug.",
7763
7744
  WORKSPACES_TOOL_SCHEMAS.createWorkspace,
7764
7745
  async (params) => {
7765
7746
  const workspace = await service.workspaces.createWorkspace({
@@ -7790,7 +7771,7 @@ function registerWorkspacesTools(server, service) {
7790
7771
  );
7791
7772
  server.tool(
7792
7773
  "update_workspace",
7793
- "Update a workspace's name, slug, description, default status, or metadata. Only provided fields are changed; omitted fields remain unchanged. Warning: changing a workspace's slug may break existing references and URLs that depend on it.",
7774
+ "Update a workspace's name, slug, description, default flag, or metadata by id. Only provided fields change; changing the slug can break URLs and other references.",
7794
7775
  WORKSPACES_TOOL_SCHEMAS.updateWorkspace,
7795
7776
  async (params) => {
7796
7777
  const { workspace_id, is_default, metadata, ...rest } = params;
@@ -7820,7 +7801,7 @@ function registerWorkspacesTools(server, service) {
7820
7801
  );
7821
7802
  server.tool(
7822
7803
  "delete_workspace",
7823
- "Delete a workspace from your organization. Permanently deletes the workspace and all its members, configs, API keys, and resources. Cannot be undone.",
7804
+ "Delete a workspace by id. This is permanent and removes the workspace, its members, configs, API keys, and resources.",
7824
7805
  WORKSPACES_TOOL_SCHEMAS.deleteWorkspace,
7825
7806
  async (params) => {
7826
7807
  await service.workspaces.deleteWorkspace(params.workspace_id);
@@ -7843,7 +7824,7 @@ function registerWorkspacesTools(server, service) {
7843
7824
  );
7844
7825
  server.tool(
7845
7826
  "add_workspace_member",
7846
- "Add an existing organization user to a workspace with a specified role (admin, manager, or member). Requires user_id as a UUID \u2014 use list_all_users to find it. For users not yet in the organization, use invite_user first.",
7827
+ "Add an existing org user to a workspace with a role. Requires a UUID user_id; use list_all_users to find it, and invite_user first if the person is not yet in the org.",
7847
7828
  WORKSPACES_TOOL_SCHEMAS.addWorkspaceMember,
7848
7829
  async (params) => {
7849
7830
  const member = await service.workspaces.addWorkspaceMember(
@@ -7872,7 +7853,7 @@ function registerWorkspacesTools(server, service) {
7872
7853
  );
7873
7854
  server.tool(
7874
7855
  "list_workspace_members",
7875
- "List all members of a workspace, returning each member's user_id, name, organization role, workspace role, and status. Use this to discover user_id values needed for get_workspace_member, update_workspace_member, or remove_workspace_member.",
7856
+ "List every member in a workspace with organization role, workspace role, status, and timestamps. Use this to find a user_id before get_workspace_member, update_workspace_member, or remove_workspace_member.",
7876
7857
  WORKSPACES_TOOL_SCHEMAS.listWorkspaceMembers,
7877
7858
  async (params) => {
7878
7859
  const members = await service.workspaces.listWorkspaceMembers(
@@ -7897,7 +7878,7 @@ function registerWorkspacesTools(server, service) {
7897
7878
  );
7898
7879
  server.tool(
7899
7880
  "get_workspace_member",
7900
- "Get details about a single workspace member by workspace_id and user_id. Returns the member's name, organization role, workspace role, and status. Unlike list_workspace_members, this fetches a single member directly when you already know both IDs.",
7881
+ "Get one workspace member by workspace_id and user_id. Use this when you already know both IDs; use list_workspace_members to browse the full roster.",
7901
7882
  WORKSPACES_TOOL_SCHEMAS.getWorkspaceMember,
7902
7883
  async (params) => {
7903
7884
  const member = await service.workspaces.getWorkspaceMember(
@@ -7916,7 +7897,7 @@ function registerWorkspacesTools(server, service) {
7916
7897
  );
7917
7898
  server.tool(
7918
7899
  "update_workspace_member",
7919
- "Update a workspace member's role. Only the role can be changed \u2014 valid values are admin, manager, or member. Use list_workspace_members or get_workspace_member to check the current role first.",
7900
+ "Update a workspace member's role by workspace_id and user_id. Only the role changes here; use list_workspace_members or get_workspace_member to confirm the current assignment first.",
7920
7901
  WORKSPACES_TOOL_SCHEMAS.updateWorkspaceMember,
7921
7902
  async (params) => {
7922
7903
  const member = await service.workspaces.updateWorkspaceMember(
@@ -7945,7 +7926,7 @@ function registerWorkspacesTools(server, service) {
7945
7926
  );
7946
7927
  server.tool(
7947
7928
  "remove_workspace_member",
7948
- "Remove a user from a workspace, revoking their workspace-level access. This does not delete the user from the organization \u2014 use delete_user for full org removal. The user can be re-added later with add_workspace_member.",
7929
+ "Remove a user from a workspace and revoke workspace access. This does not delete the user from the organization; use delete_user for full removal.",
7949
7930
  WORKSPACES_TOOL_SCHEMAS.removeWorkspaceMember,
7950
7931
  async (params) => {
7951
7932
  await service.workspaces.removeWorkspaceMember(