portkey-admin-mcp 0.16.4 → 0.16.5
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.
- package/ENDPOINTS.md +29 -29
- package/README.md +134 -129
- package/build/index.js +516 -261
- package/build/server.js +546 -231
- package/docs/DISTRIBUTION.md +48 -24
- package/docs/VERCEL_DEPLOYMENT.md +4 -3
- package/package.json +3 -3
package/ENDPOINTS.md
CHANGED
|
@@ -153,7 +153,7 @@ Portkey currently returns the full list from `GET /configs` and ignores `current
|
|
|
153
153
|
|
|
154
154
|
Routes:
|
|
155
155
|
|
|
156
|
-
- GET/POST `/deployments`; GET/PUT/DELETE `/deployments/{id}`. DELETE archives;
|
|
156
|
+
- GET/POST `/deployments`; GET/PUT/DELETE `/deployments/{id}`. DELETE archives; `/deployments/{id}/ping` is not exposed (no tool yet).
|
|
157
157
|
- Undocumented upstream: these tools call the `/v2` base (the `/v1` base with its suffix swapped to `/v2`), while the public OpenAPI lists `/deployments` under `/v1`.
|
|
158
158
|
|
|
159
159
|
| Tool | Selection guidance and result |
|
|
@@ -171,19 +171,19 @@ Routes:
|
|
|
171
171
|
- GET/POST `/virtual-keys`; GET/PUT/DELETE `/virtual-keys/{slug}`
|
|
172
172
|
- GET `/api-keys`; POST `/api-keys/{type}/{subType}`; GET/PUT/DELETE `/api-keys/{id}`; POST `/api-keys/{id}/rotate`
|
|
173
173
|
|
|
174
|
-
| Tool | Selection guidance and result
|
|
175
|
-
| -------------------- |
|
|
176
|
-
| `list_virtual_keys` | 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.
|
|
177
|
-
| `create_virtual_key` | 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.
|
|
178
|
-
| `get_virtual_key` | 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.
|
|
179
|
-
| `update_virtual_key` | 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 success when Portkey accepts the update.
|
|
180
|
-
| `delete_virtual_key` | 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.
|
|
181
|
-
| `create_api_key` | Create a Portkey API key for auth. Org keys grant broader access; workspace keys are scoped. WARNING: The key secret is returned ONCE in the tool result and will be visible in MCP transcripts and LLM context — store it securely immediately. Using the key grants access immediately according to its scopes, defaults, and limits. Workspace keys require workspace_id and user keys require user_id.
|
|
182
|
-
| `list_api_keys` | 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, creation mode, and the last rotation timestamp when available.
|
|
183
|
-
| `get_api_key` | Fetch one API key by UUID without revealing the secret. Use this to inspect scopes, defaults, limits, expiration, reset state, and the last rotation timestamp when available before changing access.
|
|
184
|
-
| `update_api_key` | 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.
|
|
185
|
-
| `delete_api_key` | 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.
|
|
186
|
-
| `rotate_api_key` | Rotate an API key without changing its identity or scopes. The new secret is returned once and exposed to this MCP transcript, while the previous secret remains valid until key_transition_expires_at. Store the new key securely, update callers during the transition window, and never log either secret.
|
|
174
|
+
| Tool | Selection guidance and result |
|
|
175
|
+
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
176
|
+
| `list_virtual_keys` | 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. |
|
|
177
|
+
| `create_virtual_key` | 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. |
|
|
178
|
+
| `get_virtual_key` | 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. |
|
|
179
|
+
| `update_virtual_key` | 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 success when Portkey accepts the update. Limit updates read the current limits and write them back, and Portkey has no conditional writes, so concurrent limit updates to the same resource can overwrite each other. Serialize them. |
|
|
180
|
+
| `delete_virtual_key` | 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. |
|
|
181
|
+
| `create_api_key` | Create a Portkey API key for auth. Org keys grant broader access; workspace keys are scoped. WARNING: The key secret is returned ONCE in the tool result and will be visible in MCP transcripts and LLM context — store it securely immediately. Using the key grants access immediately according to its scopes, defaults, and limits. Workspace keys require workspace_id and user keys require user_id. |
|
|
182
|
+
| `list_api_keys` | 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, creation mode, and the last rotation timestamp when available. |
|
|
183
|
+
| `get_api_key` | Fetch one API key by UUID without revealing the secret. Use this to inspect scopes, defaults, limits, expiration, reset state, and the last rotation timestamp when available before changing access. |
|
|
184
|
+
| `update_api_key` | 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. Limit updates read the current limits and write them back, and Portkey has no conditional writes, so concurrent limit updates to the same resource can overwrite each other. Serialize them. |
|
|
185
|
+
| `delete_api_key` | 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. |
|
|
186
|
+
| `rotate_api_key` | Rotate an API key without changing its identity or scopes. The new secret is returned once and exposed to this MCP transcript, while the previous secret remains valid until key_transition_expires_at. Store the new key securely, update callers during the transition window, and never log either secret. |
|
|
187
187
|
|
|
188
188
|
## collections (5)
|
|
189
189
|
|
|
@@ -217,7 +217,7 @@ Routes:
|
|
|
217
217
|
| `publish_prompt` | 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. |
|
|
218
218
|
| `list_prompt_versions` | 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. |
|
|
219
219
|
| `render_prompt` | 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. |
|
|
220
|
-
| `run_prompt_completion` | 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.
|
|
220
|
+
| `run_prompt_completion` | Execute a prompt against the configured model and return the completion text, plus any tool_calls or function_call the model requested (returned as data, never executed). 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. |
|
|
221
221
|
| `migrate_prompt` | Create or update a prompt in one idempotent step for CI/CD and prompt-as-code flows, unlike create_prompt which always makes a new prompt. Looks up the prompt by name within collection_id: if missing it creates the prompt, if found with different content it adds a new version (nothing is overwritten), and if the content already matches it no-ops; dry_run reports what would happen without changing anything. Stores app/env in template_metadata; get collection_id from list_collections. Returns the action taken (created, updated, or unchanged), dry_run flag, message, prompt id, slug, and version id. |
|
|
222
222
|
| `promote_prompt` | 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. |
|
|
223
223
|
| `validate_completion_metadata` | 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. |
|
|
@@ -234,15 +234,15 @@ Routes:
|
|
|
234
234
|
| ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
235
235
|
| `get_cost_analytics` | 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. Enterprise-gated. Returns 403 on non-Enterprise Portkey plans. |
|
|
236
236
|
| `get_request_analytics` | 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. Enterprise-gated. Returns 403 on non-Enterprise Portkey plans. |
|
|
237
|
-
| `get_token_analytics` | Get token-usage time-series data with summary.
|
|
237
|
+
| `get_token_analytics` | Get token-usage time-series data with summary.total and summary.avg (average tokens per request), and per-bucket total and avg. Portkey doesn't split prompt and completion tokens in this graph. Use this for consumption trends; use get_cost_analytics when you need spend instead of token volume. Enterprise-gated. Returns 403 on non-Enterprise Portkey plans. |
|
|
238
238
|
| `get_latency_analytics` | 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. Enterprise-gated. Returns 403 on non-Enterprise Portkey plans. |
|
|
239
239
|
| `get_error_analytics` | 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. Enterprise-gated. Returns 403 on non-Enterprise Portkey plans. |
|
|
240
240
|
| `get_error_rate_analytics` | 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. Enterprise-gated. Returns 403 on non-Enterprise Portkey plans. |
|
|
241
241
|
| `get_cache_hit_latency` | 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. Enterprise-gated. Returns 403 on non-Enterprise Portkey plans. |
|
|
242
|
-
| `get_cache_hit_rate` | Get cache-effectiveness time-series data with summary.hit_rate
|
|
242
|
+
| `get_cache_hit_rate` | Get cache-effectiveness time-series data with summary.hit_rate and summary.total_hits, and per-bucket simple_hits, semantic_hits, rate, and cumulative simple and semantic cache savings. Use this to measure cache effectiveness; use get_cache_hit_latency for speed rather than hit/miss ratio. Enterprise-gated. Returns 403 on non-Enterprise Portkey plans. |
|
|
243
243
|
| `get_cache_summary` | Enterprise-gated. Get cache summary metrics for a workspace or organisation and time range: hits, average cache-hit latency, total requests, and percentage speedup. Choose workspace_slug, include_all_workspaces=true, or exclude_workspace_slugs. Use the graph cache tools when you need changes over time instead of one aggregate. Enterprise-gated. Returns 403 on non-Enterprise Portkey plans. |
|
|
244
|
-
| `get_users_analytics` | Get user
|
|
245
|
-
| `get_analytics_group_users` | 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
|
|
244
|
+
| `get_users_analytics` | Get unique-user time-series data with summary.total and per-bucket total unique users. Use this for adoption trends; use get_user_requests_analytics for per-user traffic or get_analytics_group_users for per-user cost and token detail. Enterprise-gated. Returns 403 on non-Enterprise Portkey plans. |
|
|
245
|
+
| `get_analytics_group_users` | 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 unique-user trends. Enterprise-gated. Returns 403 on non-Enterprise Portkey plans. |
|
|
246
246
|
| `get_analytics_group_models` | 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. Enterprise-gated. Returns 403 on non-Enterprise Portkey plans. |
|
|
247
247
|
| `get_analytics_group_providers` | Enterprise-gated. Get provider-grouped analytics for one workspace or organisation-wide and a time range with selectable metrics, ordering, pagination, and optional total count. Choose workspace_slug, include_all_workspaces=true, or exclude_workspace_slugs. Use this when comparing provider traffic or reliability; requested metric fields are preserved in each provider row. Enterprise-gated. Returns 403 on non-Enterprise Portkey plans. |
|
|
248
248
|
| `get_analytics_group_metadata` | 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. Enterprise-gated. Returns 403 on non-Enterprise Portkey plans. |
|
|
@@ -251,7 +251,7 @@ Routes:
|
|
|
251
251
|
| `get_analytics_group_workspaces` | Get a paginated per-workspace breakdown with total_groups, group_count, is_quota_exceeded when reported, and a workspaces array containing each workspace_slug with request count and cost. Use this for org-wide chargeback or comparing workspaces; pass workspace_slug to other analytics tools to drill into one workspace. Enterprise-gated. Returns 403 on non-Enterprise Portkey plans. |
|
|
252
252
|
| `get_error_stacks_analytics` | 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. Enterprise-gated. Returns 403 on non-Enterprise Portkey plans. |
|
|
253
253
|
| `get_error_status_codes_analytics` | 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. Enterprise-gated. Returns 403 on non-Enterprise Portkey plans. |
|
|
254
|
-
| `get_user_requests_analytics` | 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
|
|
254
|
+
| `get_user_requests_analytics` | 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 unique-user trends instead. Enterprise-gated. Returns 403 on non-Enterprise Portkey plans. |
|
|
255
255
|
| `get_rescued_requests_analytics` | 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. Enterprise-gated. Returns 403 on non-Enterprise Portkey plans. |
|
|
256
256
|
| `get_feedback_analytics` | 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. Enterprise-gated. Returns 403 on non-Enterprise Portkey plans. |
|
|
257
257
|
| `get_feedback_models_analytics` | 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. Enterprise-gated. Returns 403 on non-Enterprise Portkey plans. |
|
|
@@ -386,13 +386,13 @@ Routes:
|
|
|
386
386
|
|
|
387
387
|
- GET/POST `/providers`; GET/PUT/DELETE `/providers/{slug}`
|
|
388
388
|
|
|
389
|
-
| Tool | Selection guidance and result
|
|
390
|
-
| ----------------- |
|
|
391
|
-
| `list_providers` | 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.
|
|
392
|
-
| `create_provider` | 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.
|
|
393
|
-
| `get_provider` | Fetch one provider by slug, including limits, rate settings, expiration, and reset status. Use this to check consumption or audit configuration before updating.
|
|
394
|
-
| `update_provider` | 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.
|
|
395
|
-
| `delete_provider` | 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.
|
|
389
|
+
| Tool | Selection guidance and result |
|
|
390
|
+
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
391
|
+
| `list_providers` | 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. |
|
|
392
|
+
| `create_provider` | 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. |
|
|
393
|
+
| `get_provider` | Fetch one provider by slug, including limits, rate settings, expiration, and reset status. Use this to check consumption or audit configuration before updating. |
|
|
394
|
+
| `update_provider` | 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. Limit updates read the current limits and write them back, and Portkey has no conditional writes, so concurrent limit updates to the same resource can overwrite each other. Serialize them. |
|
|
395
|
+
| `delete_provider` | 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. |
|
|
396
396
|
|
|
397
397
|
## secret-references (5)
|
|
398
398
|
|
|
@@ -470,7 +470,7 @@ Routes:
|
|
|
470
470
|
| `list_mcp_server_capabilities` | 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. |
|
|
471
471
|
| `update_mcp_server_capabilities` | 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. |
|
|
472
472
|
| `list_mcp_server_user_access` | 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. |
|
|
473
|
-
| `update_mcp_server_user_access` | 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.
|
|
473
|
+
| `update_mcp_server_user_access` | Grant or revoke individual user access to an MCP server, and/or set the server default (default_user_access) for users without an override. 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. |
|
|
474
474
|
<!-- tool-catalog:end -->
|
|
475
475
|
|
|
476
476
|
## Current wire-contract notes
|
|
@@ -489,7 +489,7 @@ Routes:
|
|
|
489
489
|
- Deployment registration or authentication rotation may return one-time secrets.
|
|
490
490
|
Tool results warn that those values appear in the MCP transcript and must be
|
|
491
491
|
stored immediately. Deployment tag maps remain flat strings and list filters
|
|
492
|
-
serialize them as JSON. The
|
|
492
|
+
serialize them as JSON. The deployment ping operation (`GET /deployments/{id}/ping`) is not exposed; there is no tool for it yet.
|
|
493
493
|
- Guardrails target either LLM or MCP-tool traffic. MCP-server bulk replacement
|
|
494
494
|
removes omitted mappings, while the single-server upsert leaves other mappings
|
|
495
495
|
unchanged.
|