portkey-admin-mcp 0.3.0 → 0.3.2

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/server.js CHANGED
@@ -1881,7 +1881,7 @@ function normalizeAnalyticsParams(params) {
1881
1881
  function registerAnalyticsTools(server, service) {
1882
1882
  server.tool(
1883
1883
  "get_cost_analytics",
1884
- "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.",
1884
+ "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.",
1885
1885
  baseAnalyticsSchema,
1886
1886
  async (params) => {
1887
1887
  const analytics = await service.analytics.getCostAnalytics(
@@ -1914,7 +1914,7 @@ function registerAnalyticsTools(server, service) {
1914
1914
  );
1915
1915
  server.tool(
1916
1916
  "get_request_analytics",
1917
- "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.",
1917
+ "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.",
1918
1918
  requestAnalyticsSchema,
1919
1919
  async (params) => {
1920
1920
  const analytics = await service.analytics.getRequestAnalytics(
@@ -1949,7 +1949,7 @@ function registerAnalyticsTools(server, service) {
1949
1949
  );
1950
1950
  server.tool(
1951
1951
  "get_token_analytics",
1952
- "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.",
1952
+ "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.",
1953
1953
  baseAnalyticsSchema,
1954
1954
  async (params) => {
1955
1955
  const analytics = await service.analytics.getTokenAnalytics(
@@ -1984,7 +1984,7 @@ function registerAnalyticsTools(server, service) {
1984
1984
  );
1985
1985
  server.tool(
1986
1986
  "get_latency_analytics",
1987
- "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.",
1987
+ "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.",
1988
1988
  baseAnalyticsSchema,
1989
1989
  async (params) => {
1990
1990
  const analytics = await service.analytics.getLatencyAnalytics(
@@ -2021,7 +2021,7 @@ function registerAnalyticsTools(server, service) {
2021
2021
  );
2022
2022
  server.tool(
2023
2023
  "get_error_analytics",
2024
- "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.",
2024
+ "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.",
2025
2025
  baseAnalyticsSchema,
2026
2026
  async (params) => {
2027
2027
  const analytics = await service.analytics.getErrorAnalytics(
@@ -2052,7 +2052,7 @@ function registerAnalyticsTools(server, service) {
2052
2052
  );
2053
2053
  server.tool(
2054
2054
  "get_error_rate_analytics",
2055
- "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.",
2055
+ "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.",
2056
2056
  baseAnalyticsSchema,
2057
2057
  async (params) => {
2058
2058
  const analytics = await service.analytics.getErrorRateAnalytics(
@@ -2083,7 +2083,7 @@ function registerAnalyticsTools(server, service) {
2083
2083
  );
2084
2084
  server.tool(
2085
2085
  "get_cache_hit_latency",
2086
- "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.",
2086
+ "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.",
2087
2087
  baseAnalyticsSchema,
2088
2088
  async (params) => {
2089
2089
  const analytics = await service.analytics.getCacheHitLatency(
@@ -2116,7 +2116,7 @@ function registerAnalyticsTools(server, service) {
2116
2116
  );
2117
2117
  server.tool(
2118
2118
  "get_cache_hit_rate",
2119
- "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.",
2119
+ "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.",
2120
2120
  baseAnalyticsSchema,
2121
2121
  async (params) => {
2122
2122
  const analytics = await service.analytics.getCacheHitRate(
@@ -2151,7 +2151,7 @@ function registerAnalyticsTools(server, service) {
2151
2151
  );
2152
2152
  server.tool(
2153
2153
  "get_users_analytics",
2154
- "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.",
2154
+ "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.",
2155
2155
  baseAnalyticsSchema,
2156
2156
  async (params) => {
2157
2157
  const analytics = await service.analytics.getUsersAnalytics(
@@ -2184,7 +2184,7 @@ function registerAnalyticsTools(server, service) {
2184
2184
  );
2185
2185
  server.tool(
2186
2186
  "get_error_stacks_analytics",
2187
- "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.",
2187
+ "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.",
2188
2188
  baseAnalyticsSchema,
2189
2189
  async (params) => {
2190
2190
  const analytics = await service.analytics.getErrorStacksAnalytics(
@@ -2206,7 +2206,7 @@ function registerAnalyticsTools(server, service) {
2206
2206
  );
2207
2207
  server.tool(
2208
2208
  "get_error_status_codes_analytics",
2209
- "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.",
2209
+ "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.",
2210
2210
  baseAnalyticsSchema,
2211
2211
  async (params) => {
2212
2212
  const analytics = await service.analytics.getErrorStatusCodesAnalytics(
@@ -2228,7 +2228,7 @@ function registerAnalyticsTools(server, service) {
2228
2228
  );
2229
2229
  server.tool(
2230
2230
  "get_user_requests_analytics",
2231
- "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.",
2231
+ "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.",
2232
2232
  baseAnalyticsSchema,
2233
2233
  async (params) => {
2234
2234
  const analytics = await service.analytics.getUserRequestsAnalytics(
@@ -2250,7 +2250,7 @@ function registerAnalyticsTools(server, service) {
2250
2250
  );
2251
2251
  server.tool(
2252
2252
  "get_rescued_requests_analytics",
2253
- "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.",
2253
+ "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.",
2254
2254
  baseAnalyticsSchema,
2255
2255
  async (params) => {
2256
2256
  const analytics = await service.analytics.getRescuedRequestsAnalytics(
@@ -2272,7 +2272,7 @@ function registerAnalyticsTools(server, service) {
2272
2272
  );
2273
2273
  server.tool(
2274
2274
  "get_feedback_analytics",
2275
- "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.",
2275
+ "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.",
2276
2276
  baseAnalyticsSchema,
2277
2277
  async (params) => {
2278
2278
  const analytics = await service.analytics.getFeedbackAnalytics(
@@ -2294,7 +2294,7 @@ function registerAnalyticsTools(server, service) {
2294
2294
  );
2295
2295
  server.tool(
2296
2296
  "get_feedback_models_analytics",
2297
- "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.",
2297
+ "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.",
2298
2298
  baseAnalyticsSchema,
2299
2299
  async (params) => {
2300
2300
  const analytics = await service.analytics.getFeedbackModelsAnalytics(
@@ -2316,7 +2316,7 @@ function registerAnalyticsTools(server, service) {
2316
2316
  );
2317
2317
  server.tool(
2318
2318
  "get_feedback_scores_analytics",
2319
- "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.",
2319
+ "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.",
2320
2320
  baseAnalyticsSchema,
2321
2321
  async (params) => {
2322
2322
  const analytics = await service.analytics.getFeedbackScoresAnalytics(
@@ -2338,7 +2338,7 @@ function registerAnalyticsTools(server, service) {
2338
2338
  );
2339
2339
  server.tool(
2340
2340
  "get_feedback_weighted_analytics",
2341
- "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.",
2341
+ "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.",
2342
2342
  baseAnalyticsSchema,
2343
2343
  async (params) => {
2344
2344
  const analytics = await service.analytics.getFeedbackWeightedAnalytics(
@@ -2360,7 +2360,7 @@ function registerAnalyticsTools(server, service) {
2360
2360
  );
2361
2361
  server.tool(
2362
2362
  "get_analytics_group_users",
2363
- "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.",
2363
+ "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.",
2364
2364
  paginatedAnalyticsSchema,
2365
2365
  async (params) => {
2366
2366
  const analytics = await service.analytics.getAnalyticsGroupUsers(
@@ -2382,7 +2382,7 @@ function registerAnalyticsTools(server, service) {
2382
2382
  );
2383
2383
  server.tool(
2384
2384
  "get_analytics_group_models",
2385
- "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.",
2385
+ "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.",
2386
2386
  paginatedAnalyticsSchema,
2387
2387
  async (params) => {
2388
2388
  const analytics = await service.analytics.getAnalyticsGroupModels(
@@ -2404,7 +2404,7 @@ function registerAnalyticsTools(server, service) {
2404
2404
  );
2405
2405
  server.tool(
2406
2406
  "get_analytics_group_metadata",
2407
- "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.",
2407
+ "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.",
2408
2408
  analyticsGroupMetadataSchema,
2409
2409
  async (params) => {
2410
2410
  const { metadata_key, ...analyticsParams } = params;
@@ -2454,7 +2454,7 @@ var AUDIT_TOOL_SCHEMAS = {
2454
2454
  function registerAuditTools(server, service) {
2455
2455
  server.tool(
2456
2456
  "list_audit_logs",
2457
- "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.",
2457
+ "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.",
2458
2458
  AUDIT_TOOL_SCHEMAS.listAuditLogs,
2459
2459
  async (params) => {
2460
2460
  const result = await service.audit.listAuditLogs({
@@ -2534,7 +2534,7 @@ var COLLECTIONS_TOOL_SCHEMAS = {
2534
2534
  function registerCollectionsTools(server, service) {
2535
2535
  server.tool(
2536
2536
  "list_collections",
2537
- "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.",
2537
+ "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.",
2538
2538
  COLLECTIONS_TOOL_SCHEMAS.listCollections,
2539
2539
  async (params) => {
2540
2540
  const collections = await service.collections.listCollections(params);
@@ -2564,7 +2564,7 @@ function registerCollectionsTools(server, service) {
2564
2564
  );
2565
2565
  server.tool(
2566
2566
  "create_collection",
2567
- "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.",
2567
+ "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.",
2568
2568
  COLLECTIONS_TOOL_SCHEMAS.createCollection,
2569
2569
  async (params) => {
2570
2570
  const result = await service.collections.createCollection(params);
@@ -2588,7 +2588,7 @@ function registerCollectionsTools(server, service) {
2588
2588
  );
2589
2589
  server.tool(
2590
2590
  "get_collection",
2591
- "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.",
2591
+ "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.",
2592
2592
  COLLECTIONS_TOOL_SCHEMAS.getCollection,
2593
2593
  async (params) => {
2594
2594
  const collection = await service.collections.getCollection(
@@ -2617,7 +2617,7 @@ function registerCollectionsTools(server, service) {
2617
2617
  );
2618
2618
  server.tool(
2619
2619
  "update_collection",
2620
- "Update a collection's display name or description. Does not affect prompts within the collection.",
2620
+ "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.",
2621
2621
  COLLECTIONS_TOOL_SCHEMAS.updateCollection,
2622
2622
  async (params) => {
2623
2623
  await service.collections.updateCollection(params.collection_id, {
@@ -2643,7 +2643,7 @@ function registerCollectionsTools(server, service) {
2643
2643
  );
2644
2644
  server.tool(
2645
2645
  "delete_collection",
2646
- "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.",
2646
+ "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.",
2647
2647
  COLLECTIONS_TOOL_SCHEMAS.deleteCollection,
2648
2648
  async (params) => {
2649
2649
  const result = await service.collections.deleteCollection(
@@ -2741,7 +2741,7 @@ function hasConfigSettings(config) {
2741
2741
  function registerConfigsTools(server, service) {
2742
2742
  server.tool(
2743
2743
  "list_configs",
2744
- "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.",
2744
+ "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.",
2745
2745
  CONFIGS_TOOL_SCHEMAS.listConfigs,
2746
2746
  async () => {
2747
2747
  const configs = await service.configs.listConfigs();
@@ -2775,7 +2775,7 @@ function registerConfigsTools(server, service) {
2775
2775
  );
2776
2776
  server.tool(
2777
2777
  "get_config",
2778
- "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.",
2778
+ "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.",
2779
2779
  CONFIGS_TOOL_SCHEMAS.getConfig,
2780
2780
  async (params) => {
2781
2781
  const response = await service.configs.getConfig(params.slug);
@@ -2819,7 +2819,7 @@ function registerConfigsTools(server, service) {
2819
2819
  );
2820
2820
  server.tool(
2821
2821
  "create_config",
2822
- "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.",
2822
+ "Create a config that defines routing, cache, retry, and targets for requests; use update_config to modify an existing one and list_config_versions for history. At least one setting is required, new configs become active immediately once referenced by a key or prompt, and the call returns the new id and version_id.",
2823
2823
  CONFIGS_TOOL_SCHEMAS.createConfig,
2824
2824
  async (params) => {
2825
2825
  const config = buildConfigPayload(params);
@@ -2859,7 +2859,7 @@ function registerConfigsTools(server, service) {
2859
2859
  );
2860
2860
  server.tool(
2861
2861
  "update_config",
2862
- "Update an existing configuration's cache, retry, or routing settings. Creates a new version; only provided fields are updated, unspecified fields remain unchanged.",
2862
+ "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.",
2863
2863
  CONFIGS_TOOL_SCHEMAS.updateConfig,
2864
2864
  async (params) => {
2865
2865
  const config = buildConfigPayload(params);
@@ -2894,7 +2894,7 @@ function registerConfigsTools(server, service) {
2894
2894
  );
2895
2895
  server.tool(
2896
2896
  "delete_config",
2897
- "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.",
2897
+ "Delete a config by slug. This is permanent, removes all versions, and breaks anything still pointing at that slug; check list_config_versions first.",
2898
2898
  CONFIGS_TOOL_SCHEMAS.deleteConfig,
2899
2899
  async (params) => {
2900
2900
  const result = await service.configs.deleteConfig(params.slug);
@@ -2917,7 +2917,7 @@ function registerConfigsTools(server, service) {
2917
2917
  );
2918
2918
  server.tool(
2919
2919
  "list_config_versions",
2920
- "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.",
2920
+ "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.",
2921
2921
  CONFIGS_TOOL_SCHEMAS.listConfigVersions,
2922
2922
  async (params) => {
2923
2923
  const result = await service.configs.listConfigVersions(params.slug);
@@ -2999,7 +2999,7 @@ var GUARDRAILS_TOOL_SCHEMAS = {
2999
2999
  function registerGuardrailsTools(server, service) {
3000
3000
  server.tool(
3001
3001
  "list_guardrails",
3002
- "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.",
3002
+ "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.",
3003
3003
  GUARDRAILS_TOOL_SCHEMAS.listGuardrails,
3004
3004
  async (params) => {
3005
3005
  const result = await service.guardrails.listGuardrails(params);
@@ -3033,7 +3033,7 @@ function registerGuardrailsTools(server, service) {
3033
3033
  );
3034
3034
  server.tool(
3035
3035
  "get_guardrail",
3036
- "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.",
3036
+ "Fetch one guardrail by id or slug with its full checks and actions; use list_guardrails to discover ids first. Use before update_guardrail or delete_guardrail when you need the exact enforcement policy, and returns the full check and action configuration alongside status and ownership.",
3037
3037
  GUARDRAILS_TOOL_SCHEMAS.getGuardrail,
3038
3038
  async (params) => {
3039
3039
  const guardrail = await service.guardrails.getGuardrail(
@@ -3068,7 +3068,7 @@ function registerGuardrailsTools(server, service) {
3068
3068
  );
3069
3069
  server.tool(
3070
3070
  "create_guardrail",
3071
- "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.",
3071
+ "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.",
3072
3072
  GUARDRAILS_TOOL_SCHEMAS.createGuardrail,
3073
3073
  async (params) => {
3074
3074
  const result = await service.guardrails.createGuardrail({
@@ -3099,7 +3099,7 @@ function registerGuardrailsTools(server, service) {
3099
3099
  );
3100
3100
  server.tool(
3101
3101
  "update_guardrail",
3102
- "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.",
3102
+ "Update a guardrail's name, checks, or actions, unlike create_guardrail which registers a new one or delete_guardrail which removes it. This creates a new version that takes effect immediately for dependent configs, so review list_guardrails first; returns the updated id, slug, and version_id.",
3103
3103
  GUARDRAILS_TOOL_SCHEMAS.updateGuardrail,
3104
3104
  async (params) => {
3105
3105
  const updateData = {};
@@ -3137,7 +3137,7 @@ function registerGuardrailsTools(server, service) {
3137
3137
  );
3138
3138
  server.tool(
3139
3139
  "delete_guardrail",
3140
- "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.",
3140
+ "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.",
3141
3141
  GUARDRAILS_TOOL_SCHEMAS.deleteGuardrail,
3142
3142
  async (params) => {
3143
3143
  const result = await service.guardrails.deleteGuardrail(
@@ -3300,7 +3300,7 @@ var INTEGRATIONS_TOOL_SCHEMAS = {
3300
3300
  function registerIntegrationsTools(server, service) {
3301
3301
  server.tool(
3302
3302
  "list_integrations",
3303
- "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.",
3303
+ "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.",
3304
3304
  INTEGRATIONS_TOOL_SCHEMAS.listIntegrations,
3305
3305
  async (params) => {
3306
3306
  const integrations = await service.integrations.listIntegrations({
@@ -3338,7 +3338,7 @@ function registerIntegrationsTools(server, service) {
3338
3338
  );
3339
3339
  server.tool(
3340
3340
  "create_integration",
3341
- "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.",
3341
+ "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.",
3342
3342
  INTEGRATIONS_TOOL_SCHEMAS.createIntegration,
3343
3343
  async (params) => {
3344
3344
  const configurations = {};
@@ -3386,7 +3386,7 @@ function registerIntegrationsTools(server, service) {
3386
3386
  );
3387
3387
  server.tool(
3388
3388
  "get_integration",
3389
- "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.",
3389
+ "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.",
3390
3390
  INTEGRATIONS_TOOL_SCHEMAS.getIntegration,
3391
3391
  async (params) => {
3392
3392
  const integration = await service.integrations.getIntegration(
@@ -3423,7 +3423,7 @@ function registerIntegrationsTools(server, service) {
3423
3423
  );
3424
3424
  server.tool(
3425
3425
  "update_integration",
3426
- "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.",
3426
+ "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.",
3427
3427
  INTEGRATIONS_TOOL_SCHEMAS.updateIntegration,
3428
3428
  async (params) => {
3429
3429
  const configurations = {};
@@ -3470,7 +3470,7 @@ function registerIntegrationsTools(server, service) {
3470
3470
  );
3471
3471
  server.tool(
3472
3472
  "delete_integration",
3473
- "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.",
3473
+ "Delete an integration by slug. This is irreversible and stops the org-level connection, which will break dependent virtual keys, providers, and workspace access.",
3474
3474
  INTEGRATIONS_TOOL_SCHEMAS.deleteIntegration,
3475
3475
  async (params) => {
3476
3476
  const result = await service.integrations.deleteIntegration(params.slug);
@@ -3493,7 +3493,7 @@ function registerIntegrationsTools(server, service) {
3493
3493
  );
3494
3494
  server.tool(
3495
3495
  "list_integration_models",
3496
- "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.",
3496
+ "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.",
3497
3497
  INTEGRATIONS_TOOL_SCHEMAS.listIntegrationModels,
3498
3498
  async (params) => {
3499
3499
  const models = await service.integrations.listIntegrationModels(
@@ -3531,7 +3531,7 @@ function registerIntegrationsTools(server, service) {
3531
3531
  );
3532
3532
  server.tool(
3533
3533
  "update_integration_models",
3534
- "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.",
3534
+ "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.",
3535
3535
  INTEGRATIONS_TOOL_SCHEMAS.updateIntegrationModels,
3536
3536
  async (params) => {
3537
3537
  const result = await service.integrations.updateIntegrationModels(
@@ -3560,7 +3560,7 @@ function registerIntegrationsTools(server, service) {
3560
3560
  );
3561
3561
  server.tool(
3562
3562
  "delete_integration_model",
3563
- "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.",
3563
+ "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.",
3564
3564
  INTEGRATIONS_TOOL_SCHEMAS.deleteIntegrationModel,
3565
3565
  async (params) => {
3566
3566
  const result = await service.integrations.deleteIntegrationModel(
@@ -3586,7 +3586,7 @@ function registerIntegrationsTools(server, service) {
3586
3586
  );
3587
3587
  server.tool(
3588
3588
  "list_integration_workspaces",
3589
- "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.",
3589
+ "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.",
3590
3590
  INTEGRATIONS_TOOL_SCHEMAS.listIntegrationWorkspaces,
3591
3591
  async (params) => {
3592
3592
  const workspaces = await service.integrations.listIntegrationWorkspaces(
@@ -3625,7 +3625,7 @@ function registerIntegrationsTools(server, service) {
3625
3625
  );
3626
3626
  server.tool(
3627
3627
  "update_integration_workspaces",
3628
- "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.",
3628
+ "Control which workspaces can use an integration and set per-workspace limits, unlike update_integration which edits the org-level connection. Call list_integration_workspaces first to review current state; access changes and new limits apply to downstream usage immediately, and the call returns success plus the number of workspaces updated.",
3629
3629
  INTEGRATIONS_TOOL_SCHEMAS.updateIntegrationWorkspaces,
3630
3630
  async (params) => {
3631
3631
  const result = await service.integrations.updateIntegrationWorkspaces(
@@ -3753,7 +3753,7 @@ var KEYS_TOOL_SCHEMAS = {
3753
3753
  function registerKeysTools(server, service) {
3754
3754
  server.tool(
3755
3755
  "list_virtual_keys",
3756
- "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.",
3756
+ "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.",
3757
3757
  KEYS_TOOL_SCHEMAS.listVirtualKeys,
3758
3758
  async () => {
3759
3759
  const virtualKeys = await service.keys.listVirtualKeys();
@@ -3794,7 +3794,7 @@ function registerKeysTools(server, service) {
3794
3794
  );
3795
3795
  server.tool(
3796
3796
  "create_virtual_key",
3797
- "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.",
3797
+ "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.",
3798
3798
  KEYS_TOOL_SCHEMAS.createVirtualKey,
3799
3799
  async (params) => {
3800
3800
  const result = await service.keys.createVirtualKey({
@@ -3833,7 +3833,7 @@ function registerKeysTools(server, service) {
3833
3833
  );
3834
3834
  server.tool(
3835
3835
  "get_virtual_key",
3836
- "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.",
3836
+ "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.",
3837
3837
  KEYS_TOOL_SCHEMAS.getVirtualKey,
3838
3838
  async (params) => {
3839
3839
  const virtualKey = await service.keys.getVirtualKey(params.slug);
@@ -3871,7 +3871,7 @@ function registerKeysTools(server, service) {
3871
3871
  );
3872
3872
  server.tool(
3873
3873
  "update_virtual_key",
3874
- "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.",
3874
+ "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.",
3875
3875
  KEYS_TOOL_SCHEMAS.updateVirtualKey,
3876
3876
  async (params) => {
3877
3877
  const result = await service.keys.updateVirtualKey(params.slug, {
@@ -3905,7 +3905,7 @@ function registerKeysTools(server, service) {
3905
3905
  );
3906
3906
  server.tool(
3907
3907
  "delete_virtual_key",
3908
- "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.",
3908
+ "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.",
3909
3909
  KEYS_TOOL_SCHEMAS.deleteVirtualKey,
3910
3910
  async (params) => {
3911
3911
  const result = await service.keys.deleteVirtualKey(params.slug);
@@ -3928,7 +3928,7 @@ function registerKeysTools(server, service) {
3928
3928
  );
3929
3929
  server.tool(
3930
3930
  "create_api_key",
3931
- "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.",
3931
+ "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.",
3932
3932
  KEYS_TOOL_SCHEMAS.createApiKey,
3933
3933
  async (params) => {
3934
3934
  if (params.type === "workspace" && !params.workspace_id) {
@@ -3999,7 +3999,7 @@ function registerKeysTools(server, service) {
3999
3999
  );
4000
4000
  server.tool(
4001
4001
  "list_api_keys",
4002
- "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.",
4002
+ "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.",
4003
4003
  KEYS_TOOL_SCHEMAS.listApiKeys,
4004
4004
  async (params) => {
4005
4005
  const apiKeys = await service.keys.listApiKeys({
@@ -4052,7 +4052,7 @@ function registerKeysTools(server, service) {
4052
4052
  );
4053
4053
  server.tool(
4054
4054
  "get_api_key",
4055
- "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.",
4055
+ "Fetch one API key by UUID without revealing the secret. Use this to inspect scopes, defaults, limits, expiration, and reset state before changing access.",
4056
4056
  KEYS_TOOL_SCHEMAS.getApiKey,
4057
4057
  async (params) => {
4058
4058
  const apiKey = await service.keys.getApiKey(params.id);
@@ -4099,7 +4099,7 @@ function registerKeysTools(server, service) {
4099
4099
  );
4100
4100
  server.tool(
4101
4101
  "update_api_key",
4102
- "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.",
4102
+ "Update an API key's name, description, scopes, defaults, or limits, unlike delete_api_key which revokes it or create_api_key which issues a new one. Changes take effect immediately for downstream callers, type and sub-type stay fixed after creation, and the call returns success without rotating the secret.",
4103
4103
  KEYS_TOOL_SCHEMAS.updateApiKey,
4104
4104
  async (params) => {
4105
4105
  const result = await service.keys.updateApiKey(params.id, {
@@ -4137,7 +4137,7 @@ function registerKeysTools(server, service) {
4137
4137
  );
4138
4138
  server.tool(
4139
4139
  "delete_api_key",
4140
- "Delete an API key by UUID. This action cannot be undone. Immediately revokes authentication; active sessions using this key will fail.",
4140
+ "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.",
4141
4141
  KEYS_TOOL_SCHEMAS.deleteApiKey,
4142
4142
  async (params) => {
4143
4143
  const result = await service.keys.deleteApiKey(params.id);
@@ -4197,7 +4197,7 @@ var LABELS_TOOL_SCHEMAS = {
4197
4197
  function registerLabelsTools(server, service) {
4198
4198
  server.tool(
4199
4199
  "create_prompt_label",
4200
- "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.",
4200
+ "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.",
4201
4201
  LABELS_TOOL_SCHEMAS.createPromptLabel,
4202
4202
  async (params) => {
4203
4203
  if (!params.organisation_id && !params.workspace_id) {
@@ -4237,7 +4237,7 @@ function registerLabelsTools(server, service) {
4237
4237
  );
4238
4238
  server.tool(
4239
4239
  "list_prompt_labels",
4240
- "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.",
4240
+ "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.",
4241
4241
  LABELS_TOOL_SCHEMAS.listPromptLabels,
4242
4242
  async (params) => {
4243
4243
  const result = await service.labels.listLabels(params);
@@ -4269,7 +4269,7 @@ function registerLabelsTools(server, service) {
4269
4269
  );
4270
4270
  server.tool(
4271
4271
  "get_prompt_label",
4272
- "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.",
4272
+ "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.",
4273
4273
  LABELS_TOOL_SCHEMAS.getPromptLabel,
4274
4274
  async (params) => {
4275
4275
  const label = await service.labels.getLabel(params.label_id, {
@@ -4303,7 +4303,7 @@ function registerLabelsTools(server, service) {
4303
4303
  );
4304
4304
  server.tool(
4305
4305
  "update_prompt_label",
4306
- "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.",
4306
+ "Update a prompt label's name, description, or color only, unlike update_prompt_version which changes which label a version carries. This takes effect immediately for all versions already tagged with the label, but does not reassign labels or touch history; use list_prompt_labels to find the label_id first.",
4307
4307
  LABELS_TOOL_SCHEMAS.updatePromptLabel,
4308
4308
  async (params) => {
4309
4309
  const { label_id, ...updateData } = params;
@@ -4327,7 +4327,7 @@ function registerLabelsTools(server, service) {
4327
4327
  );
4328
4328
  server.tool(
4329
4329
  "delete_prompt_label",
4330
- "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.",
4330
+ "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.",
4331
4331
  LABELS_TOOL_SCHEMAS.deletePromptLabel,
4332
4332
  async (params) => {
4333
4333
  await service.labels.deleteLabel(params.label_id);
@@ -4479,7 +4479,7 @@ function formatUsageLimitEntity(entity) {
4479
4479
  function registerLimitsTools(server, service) {
4480
4480
  server.tool(
4481
4481
  "list_rate_limits",
4482
- "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).",
4482
+ "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.",
4483
4483
  LIMITS_TOOL_SCHEMAS.listRateLimits,
4484
4484
  async (params) => {
4485
4485
  const result = await service.limits.listRateLimits(params.workspace_id);
@@ -4502,7 +4502,7 @@ function registerLimitsTools(server, service) {
4502
4502
  );
4503
4503
  server.tool(
4504
4504
  "get_rate_limit",
4505
- "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.",
4505
+ "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.",
4506
4506
  LIMITS_TOOL_SCHEMAS.getRateLimit,
4507
4507
  async (params) => {
4508
4508
  const result = await service.limits.getRateLimit(params.id);
@@ -4518,7 +4518,7 @@ function registerLimitsTools(server, service) {
4518
4518
  );
4519
4519
  server.tool(
4520
4520
  "create_rate_limit",
4521
- "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.",
4521
+ "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.",
4522
4522
  LIMITS_TOOL_SCHEMAS.createRateLimit,
4523
4523
  async (params) => {
4524
4524
  const result = await service.limits.createRateLimit({
@@ -4550,7 +4550,7 @@ function registerLimitsTools(server, service) {
4550
4550
  );
4551
4551
  server.tool(
4552
4552
  "update_rate_limit",
4553
- "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.",
4553
+ "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.",
4554
4554
  LIMITS_TOOL_SCHEMAS.updateRateLimit,
4555
4555
  async (params) => {
4556
4556
  const result = await service.limits.updateRateLimit(params.id, {
@@ -4577,7 +4577,7 @@ function registerLimitsTools(server, service) {
4577
4577
  );
4578
4578
  server.tool(
4579
4579
  "delete_rate_limit",
4580
- "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.",
4580
+ "Delete a rate limit by id. This is permanent and removes throttling immediately; review dependent configs and virtual keys before deleting.",
4581
4581
  LIMITS_TOOL_SCHEMAS.deleteRateLimit,
4582
4582
  async (params) => {
4583
4583
  await service.limits.deleteRateLimit(params.id);
@@ -4600,7 +4600,7 @@ function registerLimitsTools(server, service) {
4600
4600
  );
4601
4601
  server.tool(
4602
4602
  "list_usage_limits",
4603
- "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.",
4603
+ "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.",
4604
4604
  LIMITS_TOOL_SCHEMAS.listUsageLimits,
4605
4605
  async (params) => {
4606
4606
  const result = await service.limits.listUsageLimits(params.workspace_id);
@@ -4623,7 +4623,7 @@ function registerLimitsTools(server, service) {
4623
4623
  );
4624
4624
  server.tool(
4625
4625
  "get_usage_limit",
4626
- "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.",
4626
+ "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.",
4627
4627
  LIMITS_TOOL_SCHEMAS.getUsageLimit,
4628
4628
  async (params) => {
4629
4629
  const result = await service.limits.getUsageLimit(params.id);
@@ -4639,7 +4639,7 @@ function registerLimitsTools(server, service) {
4639
4639
  );
4640
4640
  server.tool(
4641
4641
  "create_usage_limit",
4642
- "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.",
4642
+ "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.",
4643
4643
  LIMITS_TOOL_SCHEMAS.createUsageLimit,
4644
4644
  async (params) => {
4645
4645
  const result = await service.limits.createUsageLimit({
@@ -4672,7 +4672,7 @@ function registerLimitsTools(server, service) {
4672
4672
  );
4673
4673
  server.tool(
4674
4674
  "update_usage_limit",
4675
- "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.",
4675
+ "Update a usage limit's name, credit_limit, alert_threshold, reset schedule, or reset target by id, unlike update_rate_limit which tunes request throttling. New values apply immediately to tracked usage, conditions and group_by are immutable after creation, and the call returns the updated id without clearing accumulated usage (use reset_usage_limit_entity for that).",
4676
4676
  LIMITS_TOOL_SCHEMAS.updateUsageLimit,
4677
4677
  async (params) => {
4678
4678
  const result = await service.limits.updateUsageLimit(params.id, {
@@ -4701,7 +4701,7 @@ function registerLimitsTools(server, service) {
4701
4701
  );
4702
4702
  server.tool(
4703
4703
  "delete_usage_limit",
4704
- "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.",
4704
+ "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.",
4705
4705
  LIMITS_TOOL_SCHEMAS.deleteUsageLimit,
4706
4706
  async (params) => {
4707
4707
  await service.limits.deleteUsageLimit(params.id);
@@ -4724,7 +4724,7 @@ function registerLimitsTools(server, service) {
4724
4724
  );
4725
4725
  server.tool(
4726
4726
  "list_usage_limit_entities",
4727
- "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.",
4727
+ "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.",
4728
4728
  LIMITS_TOOL_SCHEMAS.listUsageLimitEntities,
4729
4729
  async (params) => {
4730
4730
  const result = await service.limits.listUsageLimitEntities(
@@ -4749,7 +4749,7 @@ function registerLimitsTools(server, service) {
4749
4749
  );
4750
4750
  server.tool(
4751
4751
  "reset_usage_limit_entity",
4752
- "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.",
4752
+ "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.",
4753
4753
  LIMITS_TOOL_SCHEMAS.resetUsageLimitEntity,
4754
4754
  async (params) => {
4755
4755
  await service.limits.resetUsageLimitEntity(
@@ -4866,7 +4866,7 @@ var LOGGING_TOOL_SCHEMAS = {
4866
4866
  function registerLoggingTools(server, service) {
4867
4867
  server.tool(
4868
4868
  "insert_log",
4869
- "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.",
4869
+ "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.",
4870
4870
  LOGGING_TOOL_SCHEMAS.insertLog,
4871
4871
  async (params) => {
4872
4872
  const entry = {
@@ -4914,7 +4914,7 @@ function registerLoggingTools(server, service) {
4914
4914
  );
4915
4915
  server.tool(
4916
4916
  "create_log_export",
4917
- "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.",
4917
+ "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.",
4918
4918
  LOGGING_TOOL_SCHEMAS.createLogExport,
4919
4919
  async (params) => {
4920
4920
  const result = await service.logging.createLogExport({
@@ -4952,7 +4952,7 @@ function registerLoggingTools(server, service) {
4952
4952
  );
4953
4953
  server.tool(
4954
4954
  "list_log_exports",
4955
- "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.",
4955
+ "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.",
4956
4956
  LOGGING_TOOL_SCHEMAS.listLogExports,
4957
4957
  async (params) => {
4958
4958
  const result = await service.logging.listLogExports({
@@ -4987,7 +4987,7 @@ function registerLoggingTools(server, service) {
4987
4987
  );
4988
4988
  server.tool(
4989
4989
  "get_log_export",
4990
- "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.",
4990
+ "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.",
4991
4991
  LOGGING_TOOL_SCHEMAS.getLogExport,
4992
4992
  async (params) => {
4993
4993
  const result = await service.logging.getLogExport(params.export_id);
@@ -5018,7 +5018,7 @@ function registerLoggingTools(server, service) {
5018
5018
  );
5019
5019
  server.tool(
5020
5020
  "start_log_export",
5021
- "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.",
5021
+ "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.",
5022
5022
  LOGGING_TOOL_SCHEMAS.startLogExport,
5023
5023
  async (params) => {
5024
5024
  const result = await service.logging.startLogExport(params.export_id);
@@ -5042,7 +5042,7 @@ function registerLoggingTools(server, service) {
5042
5042
  );
5043
5043
  server.tool(
5044
5044
  "cancel_log_export",
5045
- "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.",
5045
+ "Cancel a pending or running log export job, unlike start_log_export which queues one or delete_integration which removes the source. This permanently stops that export, takes effect immediately, and does not roll back already-processed rows; call create_log_export and start_log_export again to retry.",
5046
5046
  LOGGING_TOOL_SCHEMAS.cancelLogExport,
5047
5047
  async (params) => {
5048
5048
  const result = await service.logging.cancelLogExport(params.export_id);
@@ -5066,7 +5066,7 @@ function registerLoggingTools(server, service) {
5066
5066
  );
5067
5067
  server.tool(
5068
5068
  "download_log_export",
5069
- "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.",
5069
+ "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.",
5070
5070
  LOGGING_TOOL_SCHEMAS.downloadLogExport,
5071
5071
  async (params) => {
5072
5072
  const result = await service.logging.downloadLogExport(params.export_id);
@@ -5090,7 +5090,7 @@ function registerLoggingTools(server, service) {
5090
5090
  );
5091
5091
  server.tool(
5092
5092
  "update_log_export",
5093
- "Update an existing log export configuration. Only time_of_generation_max, requested_fields, and workspace_id can be modified after creation.",
5093
+ "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.",
5094
5094
  LOGGING_TOOL_SCHEMAS.updateLogExport,
5095
5095
  async (params) => {
5096
5096
  const updateData = {};
@@ -5257,7 +5257,7 @@ function formatMcpIntegrationWorkspace(workspace) {
5257
5257
  function registerMcpIntegrationsTools(server, service) {
5258
5258
  server.tool(
5259
5259
  "list_mcp_integrations",
5260
- "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.",
5260
+ "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.",
5261
5261
  MCP_INTEGRATIONS_TOOL_SCHEMAS.listMcpIntegrations,
5262
5262
  async (params) => {
5263
5263
  const result = await service.mcpIntegrations.listMcpIntegrations(params);
@@ -5281,7 +5281,7 @@ function registerMcpIntegrationsTools(server, service) {
5281
5281
  );
5282
5282
  server.tool(
5283
5283
  "create_mcp_integration",
5284
- "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.",
5284
+ "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.",
5285
5285
  MCP_INTEGRATIONS_TOOL_SCHEMAS.createMcpIntegration,
5286
5286
  async (params) => {
5287
5287
  if (params.auth_type === "headers" && (!params.custom_headers || Object.keys(params.custom_headers).length === 0)) {
@@ -5320,7 +5320,7 @@ function registerMcpIntegrationsTools(server, service) {
5320
5320
  );
5321
5321
  server.tool(
5322
5322
  "get_mcp_integration",
5323
- "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.",
5323
+ "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.",
5324
5324
  MCP_INTEGRATIONS_TOOL_SCHEMAS.getMcpIntegration,
5325
5325
  async (params) => {
5326
5326
  const integration = await service.mcpIntegrations.getMcpIntegration(
@@ -5338,7 +5338,7 @@ function registerMcpIntegrationsTools(server, service) {
5338
5338
  );
5339
5339
  server.tool(
5340
5340
  "update_mcp_integration",
5341
- "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.",
5341
+ "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.",
5342
5342
  MCP_INTEGRATIONS_TOOL_SCHEMAS.updateMcpIntegration,
5343
5343
  async (params) => {
5344
5344
  const { id, custom_headers, ...rest } = params;
@@ -5365,7 +5365,7 @@ function registerMcpIntegrationsTools(server, service) {
5365
5365
  );
5366
5366
  server.tool(
5367
5367
  "delete_mcp_integration",
5368
- "Delete an MCP integration permanently. Also removes all MCP servers under this integration. Connected users will lose access immediately. This action cannot be undone.",
5368
+ "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.",
5369
5369
  MCP_INTEGRATIONS_TOOL_SCHEMAS.deleteMcpIntegration,
5370
5370
  async (params) => {
5371
5371
  await service.mcpIntegrations.deleteMcpIntegration(params.id);
@@ -5388,7 +5388,7 @@ function registerMcpIntegrationsTools(server, service) {
5388
5388
  );
5389
5389
  server.tool(
5390
5390
  "get_mcp_integration_metadata",
5391
- "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.",
5391
+ "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.",
5392
5392
  MCP_INTEGRATIONS_TOOL_SCHEMAS.getMcpIntegrationMetadata,
5393
5393
  async (params) => {
5394
5394
  const metadata = await service.mcpIntegrations.getMcpIntegrationMetadata(
@@ -5410,7 +5410,7 @@ function registerMcpIntegrationsTools(server, service) {
5410
5410
  );
5411
5411
  server.tool(
5412
5412
  "list_mcp_integration_capabilities",
5413
- "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.",
5413
+ "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.",
5414
5414
  MCP_INTEGRATIONS_TOOL_SCHEMAS.listMcpIntegrationCapabilities,
5415
5415
  async (params) => {
5416
5416
  const result = await service.mcpIntegrations.listMcpIntegrationCapabilities(params.id);
@@ -5430,7 +5430,7 @@ function registerMcpIntegrationsTools(server, service) {
5430
5430
  );
5431
5431
  server.tool(
5432
5432
  "update_mcp_integration_capabilities",
5433
- "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.",
5433
+ "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.",
5434
5434
  MCP_INTEGRATIONS_TOOL_SCHEMAS.updateMcpIntegrationCapabilities,
5435
5435
  async (params) => {
5436
5436
  await service.mcpIntegrations.updateMcpIntegrationCapabilities(
@@ -5458,7 +5458,7 @@ function registerMcpIntegrationsTools(server, service) {
5458
5458
  );
5459
5459
  server.tool(
5460
5460
  "list_mcp_integration_workspaces",
5461
- "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.",
5461
+ "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.",
5462
5462
  MCP_INTEGRATIONS_TOOL_SCHEMAS.listMcpIntegrationWorkspaces,
5463
5463
  async (params) => {
5464
5464
  const result = await service.mcpIntegrations.listMcpIntegrationWorkspaces(
@@ -5486,7 +5486,7 @@ function registerMcpIntegrationsTools(server, service) {
5486
5486
  );
5487
5487
  server.tool(
5488
5488
  "update_mcp_integration_workspaces",
5489
- "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.",
5489
+ "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.",
5490
5490
  MCP_INTEGRATIONS_TOOL_SCHEMAS.updateMcpIntegrationWorkspaces,
5491
5491
  async (params) => {
5492
5492
  await service.mcpIntegrations.updateMcpIntegrationWorkspaces(params.id, {
@@ -5601,7 +5601,7 @@ function formatMcpServerUserAccess(user) {
5601
5601
  function registerMcpServersTools(server, service) {
5602
5602
  server.tool(
5603
5603
  "list_mcp_servers",
5604
- "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.",
5604
+ "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.",
5605
5605
  MCP_SERVERS_TOOL_SCHEMAS.listMcpServers,
5606
5606
  async (params) => {
5607
5607
  const result = await service.mcpServers.listMcpServers(params);
@@ -5624,7 +5624,7 @@ function registerMcpServersTools(server, service) {
5624
5624
  );
5625
5625
  server.tool(
5626
5626
  "create_mcp_server",
5627
- "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.",
5627
+ "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.",
5628
5628
  MCP_SERVERS_TOOL_SCHEMAS.createMcpServer,
5629
5629
  async (params) => {
5630
5630
  const result = await service.mcpServers.createMcpServer(params);
@@ -5648,7 +5648,7 @@ function registerMcpServersTools(server, service) {
5648
5648
  );
5649
5649
  server.tool(
5650
5650
  "get_mcp_server",
5651
- "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.",
5651
+ "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.",
5652
5652
  MCP_SERVERS_TOOL_SCHEMAS.getMcpServer,
5653
5653
  async (params) => {
5654
5654
  const mcpServer = await service.mcpServers.getMcpServer(params.id);
@@ -5664,7 +5664,7 @@ function registerMcpServersTools(server, service) {
5664
5664
  );
5665
5665
  server.tool(
5666
5666
  "update_mcp_server",
5667
- "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.",
5667
+ "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.",
5668
5668
  MCP_SERVERS_TOOL_SCHEMAS.updateMcpServer,
5669
5669
  async (params) => {
5670
5670
  const { id, ...data } = params;
@@ -5688,7 +5688,7 @@ function registerMcpServersTools(server, service) {
5688
5688
  );
5689
5689
  server.tool(
5690
5690
  "delete_mcp_server",
5691
- "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.",
5691
+ "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.",
5692
5692
  MCP_SERVERS_TOOL_SCHEMAS.deleteMcpServer,
5693
5693
  async (params) => {
5694
5694
  await service.mcpServers.deleteMcpServer(params.id);
@@ -5711,7 +5711,7 @@ function registerMcpServersTools(server, service) {
5711
5711
  );
5712
5712
  server.tool(
5713
5713
  "test_mcp_server",
5714
- "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.",
5714
+ "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.",
5715
5715
  MCP_SERVERS_TOOL_SCHEMAS.testMcpServer,
5716
5716
  async (params) => {
5717
5717
  const result = await service.mcpServers.testMcpServer(params.id);
@@ -5727,7 +5727,7 @@ function registerMcpServersTools(server, service) {
5727
5727
  );
5728
5728
  server.tool(
5729
5729
  "list_mcp_server_capabilities",
5730
- "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.",
5730
+ "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.",
5731
5731
  MCP_SERVERS_TOOL_SCHEMAS.listMcpServerCapabilities,
5732
5732
  async (params) => {
5733
5733
  const result = await service.mcpServers.listMcpServerCapabilities(
@@ -5749,7 +5749,7 @@ function registerMcpServersTools(server, service) {
5749
5749
  );
5750
5750
  server.tool(
5751
5751
  "update_mcp_server_capabilities",
5752
- "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.",
5752
+ "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.",
5753
5753
  MCP_SERVERS_TOOL_SCHEMAS.updateMcpServerCapabilities,
5754
5754
  async (params) => {
5755
5755
  await service.mcpServers.updateMcpServerCapabilities(params.id, {
@@ -5774,7 +5774,7 @@ function registerMcpServersTools(server, service) {
5774
5774
  );
5775
5775
  server.tool(
5776
5776
  "list_mcp_server_user_access",
5777
- "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.",
5777
+ "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.",
5778
5778
  MCP_SERVERS_TOOL_SCHEMAS.listMcpServerUserAccess,
5779
5779
  async (params) => {
5780
5780
  const result = await service.mcpServers.listMcpServerUserAccess(
@@ -5800,7 +5800,7 @@ function registerMcpServersTools(server, service) {
5800
5800
  );
5801
5801
  server.tool(
5802
5802
  "update_mcp_server_user_access",
5803
- "Grant or revoke individual user access to an MCP server. Overrides the default_user_access setting for specified users. Changes take effect immediately.",
5803
+ "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.",
5804
5804
  MCP_SERVERS_TOOL_SCHEMAS.updateMcpServerUserAccess,
5805
5805
  async (params) => {
5806
5806
  await service.mcpServers.updateMcpServerUserAccess(params.id, {
@@ -5865,7 +5865,7 @@ var PARTIALS_TOOL_SCHEMAS = {
5865
5865
  function registerPartialsTools(server, service) {
5866
5866
  server.tool(
5867
5867
  "create_prompt_partial",
5868
- "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.",
5868
+ "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.",
5869
5869
  PARTIALS_TOOL_SCHEMAS.createPromptPartial,
5870
5870
  async (params) => {
5871
5871
  const result = await service.partials.createPromptPartial({
@@ -5895,7 +5895,7 @@ function registerPartialsTools(server, service) {
5895
5895
  );
5896
5896
  server.tool(
5897
5897
  "list_prompt_partials",
5898
- "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.",
5898
+ "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_prompt_partial, update_prompt_partial, delete_prompt_partial, or publish_partial.",
5899
5899
  PARTIALS_TOOL_SCHEMAS.listPromptPartials,
5900
5900
  async (params) => {
5901
5901
  const partials = await service.partials.listPromptPartials(params);
@@ -5926,7 +5926,7 @@ function registerPartialsTools(server, service) {
5926
5926
  );
5927
5927
  server.tool(
5928
5928
  "get_prompt_partial",
5929
- "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}}.",
5929
+ "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.",
5930
5930
  PARTIALS_TOOL_SCHEMAS.getPromptPartial,
5931
5931
  async (params) => {
5932
5932
  const partial = await service.partials.getPromptPartial(
@@ -5960,7 +5960,7 @@ function registerPartialsTools(server, service) {
5960
5960
  );
5961
5961
  server.tool(
5962
5962
  "update_prompt_partial",
5963
- "Update an existing prompt partial. A new version is created in archived status \u2014 use publish_partial to make it active.",
5963
+ "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.",
5964
5964
  PARTIALS_TOOL_SCHEMAS.updatePromptPartial,
5965
5965
  async (params) => {
5966
5966
  const { prompt_partial_id, ...updateData } = params;
@@ -5987,7 +5987,7 @@ function registerPartialsTools(server, service) {
5987
5987
  );
5988
5988
  server.tool(
5989
5989
  "delete_prompt_partial",
5990
- "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.",
5990
+ "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.",
5991
5991
  PARTIALS_TOOL_SCHEMAS.deletePromptPartial,
5992
5992
  async (params) => {
5993
5993
  await service.partials.deletePromptPartial(params.prompt_partial_id);
@@ -6010,7 +6010,7 @@ function registerPartialsTools(server, service) {
6010
6010
  );
6011
6011
  server.tool(
6012
6012
  "list_partial_versions",
6013
- "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.",
6013
+ "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.",
6014
6014
  PARTIALS_TOOL_SCHEMAS.listPartialVersions,
6015
6015
  async (params) => {
6016
6016
  const versions = await service.partials.listPartialVersions(
@@ -6045,7 +6045,7 @@ function registerPartialsTools(server, service) {
6045
6045
  );
6046
6046
  server.tool(
6047
6047
  "publish_partial",
6048
- "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.",
6048
+ "Publish a specific partial version as the default, unlike update_prompt_partial which creates a new draft without activating it. Use after list_partial_versions to pick a version_id; this immediately changes what {{> partial_name}} resolves to for all prompts and replaces the previously active version without a rollback path.",
6049
6049
  PARTIALS_TOOL_SCHEMAS.publishPartial,
6050
6050
  async (params) => {
6051
6051
  await service.partials.publishPartial(params.prompt_partial_id, {
@@ -6370,14 +6370,7 @@ function formatPromptListResponse(prompts, params) {
6370
6370
  function registerPromptsTools(server, service) {
6371
6371
  server.tool(
6372
6372
  "create_prompt",
6373
- `Create a new prompt template in Portkey. Supports both the legacy string template and a structured messages alias for chat prompts.
6374
-
6375
- IMPORTANT: The "string" parameter accepts TWO legacy formats:
6376
- 1. Plain text: "Hello {{name}}, how can I help?"
6377
- 2. Multi-message JSON array (MUST be a JSON-encoded string):
6378
- '[{"role":"system","content":[{"type":"text","text":"You are a helpful assistant."}]},{"role":"user","content":[{"type":"text","text":"{{user_input}}"}]}]'
6379
-
6380
- For structured prompts, prefer the "messages" alias and let the server serialize it to the legacy string format.`,
6373
+ "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.",
6381
6374
  PROMPTS_TOOL_SCHEMAS.createPrompt,
6382
6375
  async (params) => {
6383
6376
  if (!params.model && !params.ai_model_id && !params.finetune_id) {
@@ -6464,7 +6457,7 @@ For structured prompts, prefer the "messages" alias and let the server serialize
6464
6457
  );
6465
6458
  server.tool(
6466
6459
  "list_prompts",
6467
- "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.",
6460
+ "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.",
6468
6461
  PROMPTS_TOOL_SCHEMAS.listPrompts,
6469
6462
  async (params) => {
6470
6463
  const prompts = await service.prompts.listPrompts(params);
@@ -6484,12 +6477,7 @@ For structured prompts, prefer the "messages" alias and let the server serialize
6484
6477
  );
6485
6478
  server.tool(
6486
6479
  "get_prompt",
6487
- `Retrieve detailed information about a specific prompt including its template, parameters, and version history.
6488
-
6489
- The template field shows the raw "string" value stored in Portkey:
6490
- - If it starts with "[", it is a JSON-encoded messages array (multi-message prompt with roles).
6491
- - Otherwise it is a plain string template.
6492
- When updating a prompt, pass the same format back in the "string" field of update_prompt.`,
6480
+ "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.",
6493
6481
  PROMPTS_TOOL_SCHEMAS.getPrompt,
6494
6482
  async (params) => {
6495
6483
  const prompt = await service.prompts.getPrompt(params.prompt_id);
@@ -6551,14 +6539,7 @@ When updating a prompt, pass the same format back in the "string" field of updat
6551
6539
  );
6552
6540
  server.tool(
6553
6541
  "update_prompt",
6554
- `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.
6555
-
6556
- IMPORTANT: The legacy "string" parameter accepts the same two formats as create_prompt:
6557
- 1. Plain text: "Hello {{name}}"
6558
- 2. Multi-message JSON array (MUST be a JSON-encoded string):
6559
- '[{"role":"system","content":[{"type":"text","text":"..."}]},{"role":"user","content":[{"type":"text","text":"{{input}}"}]}]'
6560
-
6561
- 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.`,
6542
+ "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.",
6562
6543
  PROMPTS_TOOL_SCHEMAS.updatePrompt,
6563
6544
  async (params) => {
6564
6545
  const { prompt_id, dry_run, messages, ...updateData } = params;
@@ -6623,7 +6604,7 @@ For structured chat prompts, prefer the "messages" alias and let the server seri
6623
6604
  );
6624
6605
  server.tool(
6625
6606
  "delete_prompt",
6626
- "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.",
6607
+ "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.",
6627
6608
  PROMPTS_TOOL_SCHEMAS.deletePrompt,
6628
6609
  async (params) => {
6629
6610
  await service.prompts.deletePrompt(params.prompt_id);
@@ -6646,7 +6627,7 @@ For structured chat prompts, prefer the "messages" alias and let the server seri
6646
6627
  );
6647
6628
  server.tool(
6648
6629
  "publish_prompt",
6649
- "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.",
6630
+ "Publish a specific version of a prompt as the active default, unlike promote_prompt which copies across environments or update_prompt which creates a new draft. This immediately routes all callers using the slug to that version and there is no rollback, so use list_prompt_versions to pick the version and update_prompt first if you need to create new content before promoting it.",
6650
6631
  PROMPTS_TOOL_SCHEMAS.publishPrompt,
6651
6632
  async (params) => {
6652
6633
  await service.prompts.publishPrompt(params.prompt_id, {
@@ -6673,7 +6654,7 @@ For structured chat prompts, prefer the "messages" alias and let the server seri
6673
6654
  );
6674
6655
  server.tool(
6675
6656
  "list_prompt_versions",
6676
- "List all versions of a specific prompt with their details, including version number, description, template content, and creation date.",
6657
+ "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.",
6677
6658
  PROMPTS_TOOL_SCHEMAS.listPromptVersions,
6678
6659
  async (params) => {
6679
6660
  const versions = await service.prompts.listPromptVersions(
@@ -6711,7 +6692,7 @@ For structured chat prompts, prefer the "messages" alias and let the server seri
6711
6692
  );
6712
6693
  server.tool(
6713
6694
  "render_prompt",
6714
- "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.",
6695
+ "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.",
6715
6696
  PROMPTS_TOOL_SCHEMAS.renderPrompt,
6716
6697
  async (params) => {
6717
6698
  const result = await service.prompts.renderPrompt(params.prompt_id, {
@@ -6743,7 +6724,7 @@ For structured chat prompts, prefer the "messages" alias and let the server seri
6743
6724
  );
6744
6725
  server.tool(
6745
6726
  "run_prompt_completion",
6746
- "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.",
6727
+ "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.",
6747
6728
  PROMPTS_TOOL_SCHEMAS.runPromptCompletion,
6748
6729
  async (params) => {
6749
6730
  const result = await service.prompts.runPromptCompletion(
@@ -6782,7 +6763,7 @@ For structured chat prompts, prefer the "messages" alias and let the server seri
6782
6763
  );
6783
6764
  server.tool(
6784
6765
  "migrate_prompt",
6785
- "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.",
6766
+ "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.",
6786
6767
  PROMPTS_TOOL_SCHEMAS.migratePrompt,
6787
6768
  async (params) => {
6788
6769
  const templateString = normalizePromptTemplateString(params);
@@ -6836,7 +6817,7 @@ For structured chat prompts, prefer the "messages" alias and let the server seri
6836
6817
  );
6837
6818
  server.tool(
6838
6819
  "promote_prompt",
6839
- "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.",
6820
+ "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.",
6840
6821
  PROMPTS_TOOL_SCHEMAS.promotePrompt,
6841
6822
  async (params) => {
6842
6823
  const result = await service.prompts.promotePrompt({
@@ -6874,7 +6855,7 @@ For structured chat prompts, prefer the "messages" alias and let the server seri
6874
6855
  );
6875
6856
  server.tool(
6876
6857
  "validate_completion_metadata",
6877
- "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.",
6858
+ "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.",
6878
6859
  PROMPTS_TOOL_SCHEMAS.validateCompletionMetadata,
6879
6860
  async (params) => {
6880
6861
  const result = service.prompts.validateBillingMetadata(params);
@@ -6899,7 +6880,7 @@ For structured chat prompts, prefer the "messages" alias and let the server seri
6899
6880
  );
6900
6881
  server.tool(
6901
6882
  "get_prompt_version",
6902
- "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.",
6883
+ "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.",
6903
6884
  PROMPTS_TOOL_SCHEMAS.getPromptVersion,
6904
6885
  async (params) => {
6905
6886
  const version = await service.prompts.getPromptVersion(
@@ -6918,7 +6899,7 @@ For structured chat prompts, prefer the "messages" alias and let the server seri
6918
6899
  );
6919
6900
  server.tool(
6920
6901
  "update_prompt_version",
6921
- "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.",
6902
+ "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.",
6922
6903
  PROMPTS_TOOL_SCHEMAS.updatePromptVersion,
6923
6904
  async (params) => {
6924
6905
  if (params.label_id === void 0) {
@@ -7026,7 +7007,7 @@ var PROVIDERS_TOOL_SCHEMAS = {
7026
7007
  function registerProvidersTools(server, service) {
7027
7008
  server.tool(
7028
7009
  "list_providers",
7029
- "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.",
7010
+ "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.",
7030
7011
  PROVIDERS_TOOL_SCHEMAS.listProviders,
7031
7012
  async (params) => {
7032
7013
  const providers = await service.providers.listProviders({
@@ -7072,7 +7053,7 @@ function registerProvidersTools(server, service) {
7072
7053
  );
7073
7054
  server.tool(
7074
7055
  "create_provider",
7075
- "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.",
7056
+ "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.",
7076
7057
  PROVIDERS_TOOL_SCHEMAS.createProvider,
7077
7058
  async (params) => {
7078
7059
  const result = await service.providers.createProvider({
@@ -7113,7 +7094,7 @@ function registerProvidersTools(server, service) {
7113
7094
  );
7114
7095
  server.tool(
7115
7096
  "get_provider",
7116
- "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.",
7097
+ "Fetch one provider by slug, including limits, rate settings, expiration, and reset status. Use this to check consumption or audit configuration before updating.",
7117
7098
  PROVIDERS_TOOL_SCHEMAS.getProvider,
7118
7099
  async (params) => {
7119
7100
  const provider = await service.providers.getProvider(
@@ -7155,7 +7136,7 @@ function registerProvidersTools(server, service) {
7155
7136
  );
7156
7137
  server.tool(
7157
7138
  "update_provider",
7158
- "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.",
7139
+ "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.",
7159
7140
  PROVIDERS_TOOL_SCHEMAS.updateProvider,
7160
7141
  async (params) => {
7161
7142
  const result = await service.providers.updateProvider(
@@ -7198,7 +7179,7 @@ function registerProvidersTools(server, service) {
7198
7179
  );
7199
7180
  server.tool(
7200
7181
  "delete_provider",
7201
- "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.",
7182
+ "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.",
7202
7183
  PROVIDERS_TOOL_SCHEMAS.deleteProvider,
7203
7184
  async (params) => {
7204
7185
  await service.providers.deleteProvider(params.slug, params.workspace_id);
@@ -7250,7 +7231,7 @@ var TRACING_TOOL_SCHEMAS = {
7250
7231
  function registerTracingTools(server, service) {
7251
7232
  server.tool(
7252
7233
  "create_feedback",
7253
- "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).",
7234
+ "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.",
7254
7235
  TRACING_TOOL_SCHEMAS.createFeedback,
7255
7236
  async (params) => {
7256
7237
  const result = await service.tracing.createFeedback({
@@ -7279,7 +7260,7 @@ function registerTracingTools(server, service) {
7279
7260
  );
7280
7261
  server.tool(
7281
7262
  "update_feedback",
7282
- "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.",
7263
+ "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.",
7283
7264
  TRACING_TOOL_SCHEMAS.updateFeedback,
7284
7265
  async (params) => {
7285
7266
  const result = await service.tracing.updateFeedback(params.id, {
@@ -7408,7 +7389,7 @@ function formatUserAnalyticsGroup(group) {
7408
7389
  function registerUsersTools(server, service) {
7409
7390
  server.tool(
7410
7391
  "list_all_users",
7411
- "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.",
7392
+ "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.",
7412
7393
  USERS_TOOL_SCHEMAS.listAllUsers,
7413
7394
  async () => {
7414
7395
  const users = await service.users.listUsers();
@@ -7431,7 +7412,7 @@ function registerUsersTools(server, service) {
7431
7412
  );
7432
7413
  server.tool(
7433
7414
  "invite_user",
7434
- "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.",
7415
+ "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.",
7435
7416
  USERS_TOOL_SCHEMAS.inviteUser,
7436
7417
  async (params) => {
7437
7418
  const result = await service.users.inviteUser(params);
@@ -7455,7 +7436,7 @@ function registerUsersTools(server, service) {
7455
7436
  );
7456
7437
  server.tool(
7457
7438
  "get_user_stats",
7458
- "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.",
7439
+ "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.",
7459
7440
  USERS_TOOL_SCHEMAS.getUserStats,
7460
7441
  async (params) => {
7461
7442
  const stats = await service.users.getUserGroupedData(params);
@@ -7478,7 +7459,7 @@ function registerUsersTools(server, service) {
7478
7459
  );
7479
7460
  server.tool(
7480
7461
  "get_user",
7481
- "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.",
7462
+ "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.",
7482
7463
  USERS_TOOL_SCHEMAS.getUser,
7483
7464
  async (params) => {
7484
7465
  const user = await service.users.getUser(params.user_id);
@@ -7494,7 +7475,7 @@ function registerUsersTools(server, service) {
7494
7475
  );
7495
7476
  server.tool(
7496
7477
  "update_user",
7497
- "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.",
7478
+ "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.",
7498
7479
  USERS_TOOL_SCHEMAS.updateUser,
7499
7480
  async (params) => {
7500
7481
  const { user_id, ...updateData } = params;
@@ -7518,7 +7499,7 @@ function registerUsersTools(server, service) {
7518
7499
  );
7519
7500
  server.tool(
7520
7501
  "delete_user",
7521
- "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.",
7502
+ "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.",
7522
7503
  USERS_TOOL_SCHEMAS.deleteUser,
7523
7504
  async (params) => {
7524
7505
  await service.users.deleteUser(params.user_id);
@@ -7541,7 +7522,7 @@ function registerUsersTools(server, service) {
7541
7522
  );
7542
7523
  server.tool(
7543
7524
  "list_user_invites",
7544
- "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.",
7525
+ "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.",
7545
7526
  USERS_TOOL_SCHEMAS.listUserInvites,
7546
7527
  async () => {
7547
7528
  const invites = await service.users.listUserInvites();
@@ -7564,7 +7545,7 @@ function registerUsersTools(server, service) {
7564
7545
  );
7565
7546
  server.tool(
7566
7547
  "get_user_invite",
7567
- "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.",
7548
+ "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.",
7568
7549
  USERS_TOOL_SCHEMAS.getUserInvite,
7569
7550
  async (params) => {
7570
7551
  const invite = await service.users.getUserInvite(params.invite_id);
@@ -7580,7 +7561,7 @@ function registerUsersTools(server, service) {
7580
7561
  );
7581
7562
  server.tool(
7582
7563
  "delete_user_invite",
7583
- "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.",
7564
+ "Delete a pending invite and revoke its invite link. This does not affect existing users; use delete_user for full user removal.",
7584
7565
  USERS_TOOL_SCHEMAS.deleteUserInvite,
7585
7566
  async (params) => {
7586
7567
  await service.users.deleteUserInvite(params.invite_id);
@@ -7603,7 +7584,7 @@ function registerUsersTools(server, service) {
7603
7584
  );
7604
7585
  server.tool(
7605
7586
  "resend_user_invite",
7606
- "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.",
7587
+ "Resend the email for a pending invite that has not been accepted, unlike invite_user which creates a new invite. This sends a fresh email without modifying the invite record, expiry, or role; use get_user_invite first if you are unsure whether the invite still exists and list_user_invites to discover invite_ids.",
7607
7588
  USERS_TOOL_SCHEMAS.resendUserInvite,
7608
7589
  async (params) => {
7609
7590
  await service.users.resendUserInvite(params.invite_id);
@@ -7733,7 +7714,7 @@ function formatWorkspaceDetail(workspace) {
7733
7714
  function registerWorkspacesTools(server, service) {
7734
7715
  server.tool(
7735
7716
  "list_workspaces",
7736
- "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.",
7717
+ "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.",
7737
7718
  WORKSPACES_TOOL_SCHEMAS.listWorkspaces,
7738
7719
  async (params) => {
7739
7720
  const workspaces = await service.workspaces.listWorkspaces(params);
@@ -7756,7 +7737,7 @@ function registerWorkspacesTools(server, service) {
7756
7737
  );
7757
7738
  server.tool(
7758
7739
  "get_workspace",
7759
- "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.",
7740
+ "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.",
7760
7741
  WORKSPACES_TOOL_SCHEMAS.getWorkspace,
7761
7742
  async (params) => {
7762
7743
  const workspace = await service.workspaces.getWorkspace(
@@ -7774,7 +7755,7 @@ function registerWorkspacesTools(server, service) {
7774
7755
  );
7775
7756
  server.tool(
7776
7757
  "create_workspace",
7777
- "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.",
7758
+ "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.",
7778
7759
  WORKSPACES_TOOL_SCHEMAS.createWorkspace,
7779
7760
  async (params) => {
7780
7761
  const workspace = await service.workspaces.createWorkspace({
@@ -7805,7 +7786,7 @@ function registerWorkspacesTools(server, service) {
7805
7786
  );
7806
7787
  server.tool(
7807
7788
  "update_workspace",
7808
- "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.",
7789
+ "Update a workspace's name, slug, description, default flag, or metadata by id, unlike update_workspace_member which changes role assignments within a workspace. Only provided fields change and updates take effect immediately; changing the slug can break URLs, API key references, and other external links, so confirm no dependencies first.",
7809
7790
  WORKSPACES_TOOL_SCHEMAS.updateWorkspace,
7810
7791
  async (params) => {
7811
7792
  const { workspace_id, is_default, metadata, ...rest } = params;
@@ -7835,7 +7816,7 @@ function registerWorkspacesTools(server, service) {
7835
7816
  );
7836
7817
  server.tool(
7837
7818
  "delete_workspace",
7838
- "Delete a workspace from your organization. Permanently deletes the workspace and all its members, configs, API keys, and resources. Cannot be undone.",
7819
+ "Delete a workspace by id. This is permanent and removes the workspace, its members, configs, API keys, and resources.",
7839
7820
  WORKSPACES_TOOL_SCHEMAS.deleteWorkspace,
7840
7821
  async (params) => {
7841
7822
  await service.workspaces.deleteWorkspace(params.workspace_id);
@@ -7858,7 +7839,7 @@ function registerWorkspacesTools(server, service) {
7858
7839
  );
7859
7840
  server.tool(
7860
7841
  "add_workspace_member",
7861
- "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.",
7842
+ "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.",
7862
7843
  WORKSPACES_TOOL_SCHEMAS.addWorkspaceMember,
7863
7844
  async (params) => {
7864
7845
  const member = await service.workspaces.addWorkspaceMember(
@@ -7887,7 +7868,7 @@ function registerWorkspacesTools(server, service) {
7887
7868
  );
7888
7869
  server.tool(
7889
7870
  "list_workspace_members",
7890
- "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.",
7871
+ "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.",
7891
7872
  WORKSPACES_TOOL_SCHEMAS.listWorkspaceMembers,
7892
7873
  async (params) => {
7893
7874
  const members = await service.workspaces.listWorkspaceMembers(
@@ -7912,7 +7893,7 @@ function registerWorkspacesTools(server, service) {
7912
7893
  );
7913
7894
  server.tool(
7914
7895
  "get_workspace_member",
7915
- "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.",
7896
+ "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.",
7916
7897
  WORKSPACES_TOOL_SCHEMAS.getWorkspaceMember,
7917
7898
  async (params) => {
7918
7899
  const member = await service.workspaces.getWorkspaceMember(
@@ -7931,7 +7912,7 @@ function registerWorkspacesTools(server, service) {
7931
7912
  );
7932
7913
  server.tool(
7933
7914
  "update_workspace_member",
7934
- "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.",
7915
+ "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.",
7935
7916
  WORKSPACES_TOOL_SCHEMAS.updateWorkspaceMember,
7936
7917
  async (params) => {
7937
7918
  const member = await service.workspaces.updateWorkspaceMember(
@@ -7960,7 +7941,7 @@ function registerWorkspacesTools(server, service) {
7960
7941
  );
7961
7942
  server.tool(
7962
7943
  "remove_workspace_member",
7963
- "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.",
7944
+ "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.",
7964
7945
  WORKSPACES_TOOL_SCHEMAS.removeWorkspaceMember,
7965
7946
  async (params) => {
7966
7947
  await service.workspaces.removeWorkspaceMember(