vantage-mcp-server 2.10.0 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +3 -2
- package/index.js.map +2 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -360,7 +360,7 @@ On providers that have a **Not Tagged** filter option in the console, you can us
|
|
|
360
360
|
\`\`\`sql
|
|
361
361
|
(resources.provider = 'gcp' AND tags.name = NULL) OR (resources.provider = 'aws' AND tags.name = NULL)
|
|
362
362
|
\`\`\`
|
|
363
|
-
`,description:"Learn how to use VQL when querying Resource Reports in Vantage.",title:"VQL for Resource Reports"}]]));var x0="2.
|
|
363
|
+
`,description:"Learn how to use VQL when querying Resource Reports in Vantage.",title:"VQL for Resource Reports"}]]));var x0="2.11.0";var uv={name:"Vantage Cloud Costs Helper",version:x0};async function S0(e,t,r,o,n){t["User-Agent"]=`vantage-mcp-server/${uv.version}`;let i=new URL(n,e);o==="GET"?Object.entries(r).forEach(([u,l])=>{if(l!=null)if(Array.isArray(l))for(let d of l)i.searchParams.append(`${u}[]`,String(d));else i.searchParams.append(u,String(l))}):t["Content-Type"]="application/json";let s={method:o,headers:t,body:o!=="GET"?JSON.stringify(r):void 0},a=await fetch(i.toString(),s);if(!a.ok){let u=await a.text();try{let l=JSON.parse(u);if(Array.isArray(l.errors))return{errors:l.errors,ok:!1}}catch{}return{errors:[{message:"Vantage API request failed",status:a.status,endpoint:n,details:u}],ok:!1}}return a.status===204?{data:void 0,ok:!0}:{data:await a.json(),ok:!0}}var T=class{constructor(t){this.exception=t}};var lv=new Map;function I(e){let t=(r,o)=>{r.registerTool(e.name,{title:e.title,description:e.description,inputSchema:e.args,outputSchema:e.outputSchema,annotations:{readOnlyHint:e.annotations.readOnly,openWorldHint:e.annotations.openWorld,destructiveHint:e.annotations.destructive}},async n=>{try{let i=await e.execute(n,o());return e.outputSchema?{structuredContent:i}:{content:[{type:"text",text:JSON.stringify(i,null,2)}],isError:!1}}catch(i){if(i instanceof T)return{content:[{type:"text",text:JSON.stringify(i.exception,null,2)}],isError:!0};throw i}})};if(lv.has(e.name))throw new Error(`Tool ${e.name} is already registered`);return lv.set(e.name,t),e}function T0(e,t){for(let r of lv.values())r(e,t)}var J4="Invalid date input, must be YYYY-MM-DD format and a reasonable date.";function Q4(e){let t="2030-01-01",r="2010-01-01";if(!e||e===""||typeof e!="string"||e<r||e>t)return!1;let o=Date.parse(e);return!(Number.isNaN(o)||o<=Date.parse(r)||o>=Date.parse(t))}function we(e){return f.string().refine(Q4,{error:J4}).describe(e)}var Ld=f.object({start_at:we("The start date of the period."),end_at:we("The end date of the period.").optional(),amount:f.number().min(0).describe("The amount of the period.")});var Y4=`
|
|
364
364
|
Creates a budget based on the parameters specified. This is useful if you have been tasked with managing budgets
|
|
365
365
|
or you are building a cost report with budgets in mind.
|
|
366
366
|
`.trim(),UB=I({name:"create-budget",title:"Create Budget",description:Y4,annotations:{destructive:!0,openWorld:!1,readOnly:!1},args:{name:f.string().min(1).describe("The name of the Budget."),workspace_token:f.string().optional().describe("The token of the Workspace to add the Budget to."),cost_report_token:f.string().optional().describe("The CostReport token. Ignored for hierarchical Budgets."),child_budget_tokens:f.array(f.string()).optional().describe("The tokens of any child Budgets when creating a hierarchical Budget."),periods:f.array(Ld).optional().describe("The periods for the Budget. The start_at and end_at must be iso8601 formatted e.g. YYYY-MM-DD. Ignored for hierarchical Budgets.")},async execute(e,t){let r=await t.callVantageApi("/v2/budgets",e,"POST");if(!r.ok)throw new T({errors:r.errors});return r.data}});var E0=Ue(Ge());var eL=`
|
|
@@ -687,12 +687,13 @@ Recommendations can be filtered by:
|
|
|
687
687
|
- Region via regions (requires workspace_token)
|
|
688
688
|
- Tag key/value pair via tag_key + tag_value (both required together; requires workspace_token) \u2014 use this when users ask about recommendations for a specific virtual tag, e.g. "recommendations for department=engineering"
|
|
689
689
|
- Date range via start_date + end_date in YYYY-MM-DD format (both required together; requires workspace_token)
|
|
690
|
+
- Minimum monthly potential savings via min_savings
|
|
690
691
|
- Recommendation type via type (case-insensitive fuzzy matching; e.g. "AWS recommendations" -> type=aws; "EC2 rightsizing" -> type=aws:ec2:rightsizing)
|
|
691
692
|
|
|
692
693
|
The token of each recommendation can be used with other recommendation tools to get detailed information and see specific resources affected.
|
|
693
694
|
|
|
694
695
|
For users to view and manage recommendations in the Vantage Web UI, they can visit https://console.vantage.sh/recommendations
|
|
695
|
-
`.trim(),w2={page:f.number().optional().default(1).describe("The page number to return, defaults to 1"),workspace_token:f.string().optional().describe("Filter recommendations to a specific workspace"),provider:f.preprocess(W0,f.enum(F0).optional()).optional().describe("Filter recommendations by cloud provider (aws, gcp, azure, kubernetes, datadog). Aliases like 'Amazon Web Services' and 'Google Cloud' are normalized."),provider_account_id:f.string().optional().describe("Filter recommendations by provider account ID"),type:f.preprocess(y2,f.string().max(255).optional()).optional().describe("Filter recommendations by type with case-insensitive fuzzy matching (e.g., aws, aws:ec2, aws:ec2:rightsizing). Natural language values like 'AWS recommendations' are normalized."),filter:f.enum(["open","resolved","dismissed"]).optional().describe("Filter recommendations by status: open (default), resolved, or dismissed"),tag_key:f.string().optional().describe("Filter by tag key. Must be provided together with tag_value. Requires workspace_token."),tag_value:f.string().optional().describe("Filter by tag value. Must be provided together with tag_key. Requires workspace_token."),regions:f.array(f.string()).optional().describe("Filter by region slugs (e.g. us-east-1, eastus, asia-east1). Requires workspace_token."),provider_ids:f.preprocess(e=>Array.isArray(e)?e.map(W0):e,f.array(f.enum(F0)).optional()).optional().describe("Filter by one or more cloud providers. Cannot be used together with provider. Requires workspace_token. Only use this when the user explicitly asks to filter by specific cloud providers \u2014 do not infer or default to passing all providers."),account_ids:f.array(f.string()).optional().describe("Filter by cloud account identifiers (AWS account IDs, Azure subscription IDs, etc.). Cannot be used together with provider_account_id. Requires workspace_token."),billing_account_ids:f.array(f.string()).optional().describe("Filter by billing account identifiers. Requires workspace_token."),start_date:f.string().regex(/^\d{4}-\d{2}-\d{2}$/,"Must be in YYYY-MM-DD format").optional().describe("Filter recommendations created on or after this date (YYYY-MM-DD). Must be provided together with end_date. Requires workspace_token."),end_date:f.string().regex(/^\d{4}-\d{2}-\d{2}$/,"Must be in YYYY-MM-DD format").optional().describe("Filter recommendations created on or before this date (YYYY-MM-DD). Must be provided together with start_date. Requires workspace_token.")},V7=I({name:"list-recommendations",title:"List Recommendations",description:b2,annotations:{destructive:!1,openWorld:!1,readOnly:!0},args:w2,async execute(e,t){if(!!e.tag_key!=!!e.tag_value)throw new T({errors:[{message:"tag_key and tag_value must both be provided together"}]});if(!!e.start_date!=!!e.end_date)throw new T({errors:[{message:"start_date and end_date must both be provided together"}]});let r={...e,limit:128,provider:e.provider},o=await t.callVantageApi("/v2/recommendations",r,"GET");if(!o.ok)throw new T({errors:o.errors});return{recommendations:o.data.recommendations,pagination:Y(o.data)}}});var G0=Ue(Ge());var $2=`
|
|
696
|
+
`.trim(),w2={page:f.number().optional().default(1).describe("The page number to return, defaults to 1"),workspace_token:f.string().optional().describe("Filter recommendations to a specific workspace"),provider:f.preprocess(W0,f.enum(F0).optional()).optional().describe("Filter recommendations by cloud provider (aws, gcp, azure, kubernetes, datadog). Aliases like 'Amazon Web Services' and 'Google Cloud' are normalized."),provider_account_id:f.string().optional().describe("Filter recommendations by provider account ID"),type:f.preprocess(y2,f.string().max(255).optional()).optional().describe("Filter recommendations by type with case-insensitive fuzzy matching (e.g., aws, aws:ec2, aws:ec2:rightsizing). Natural language values like 'AWS recommendations' are normalized."),filter:f.enum(["open","resolved","dismissed"]).optional().describe("Filter recommendations by status: open (default), resolved, or dismissed"),min_savings:f.number().nonnegative().optional().describe("Filter to recommendations with monthly potential savings greater than or equal to this amount, in the workspace currency."),tag_key:f.string().optional().describe("Filter by tag key. Must be provided together with tag_value. Requires workspace_token."),tag_value:f.string().optional().describe("Filter by tag value. Must be provided together with tag_key. Requires workspace_token."),regions:f.array(f.string()).optional().describe("Filter by region slugs (e.g. us-east-1, eastus, asia-east1). Requires workspace_token."),provider_ids:f.preprocess(e=>Array.isArray(e)?e.map(W0):e,f.array(f.enum(F0)).optional()).optional().describe("Filter by one or more cloud providers. Cannot be used together with provider. Requires workspace_token. Only use this when the user explicitly asks to filter by specific cloud providers \u2014 do not infer or default to passing all providers."),account_ids:f.array(f.string()).optional().describe("Filter by cloud account identifiers (AWS account IDs, Azure subscription IDs, etc.). Cannot be used together with provider_account_id. Requires workspace_token."),billing_account_ids:f.array(f.string()).optional().describe("Filter by billing account identifiers. Requires workspace_token."),start_date:f.string().regex(/^\d{4}-\d{2}-\d{2}$/,"Must be in YYYY-MM-DD format").optional().describe("Filter recommendations created on or after this date (YYYY-MM-DD). Must be provided together with end_date. Requires workspace_token."),end_date:f.string().regex(/^\d{4}-\d{2}-\d{2}$/,"Must be in YYYY-MM-DD format").optional().describe("Filter recommendations created on or before this date (YYYY-MM-DD). Must be provided together with start_date. Requires workspace_token.")},V7=I({name:"list-recommendations",title:"List Recommendations",description:b2,annotations:{destructive:!1,openWorld:!1,readOnly:!0},args:w2,async execute(e,t){if(!!e.tag_key!=!!e.tag_value)throw new T({errors:[{message:"tag_key and tag_value must both be provided together"}]});if(!!e.start_date!=!!e.end_date)throw new T({errors:[{message:"start_date and end_date must both be provided together"}]});let r={...e,limit:128,provider:e.provider},o=await t.callVantageApi("/v2/recommendations",r,"GET");if(!o.ok)throw new T({errors:o.errors});return{recommendations:o.data.recommendations,pagination:Y(o.data)}}});var G0=Ue(Ge());var $2=`
|
|
696
697
|
Tags can have many values. Use this tool to find the values and service providers that are associated with a tag.
|
|
697
698
|
`.trim(),k2={page:f.number().optional().default(1).describe("The page number to return, defaults to 1"),key:f.string().min(1).describe("Tag key to list values for")},J7=I({name:"list-tag-values",title:"List Tag Values",description:$2,annotations:{destructive:!1,openWorld:!1,readOnly:!0},args:k2,async execute(e,t){let r={...e,limit:128},o=await t.callVantageApi(`/v2/tags/${(0,G0.pathEncode)(e.key)}/values`,r,"GET");if(!o.ok)throw new T({errors:o.errors});return{tag_values:o.data.tag_values,pagination:Y(o.data)}}});var x2=`
|
|
698
699
|
List tags that can be used to filter costs and cost reports.
|