vantage-mcp-server 2.6.6 → 2.6.7

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 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.6.6";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])=>{l!=null&&i.searchParams.append(u,Array.isArray(l)?l.join(","):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 z=class{constructor(t){this.exception=t}};var lv=new Map;function I(e){let t=(r,o)=>{r.registerTool(e.name,{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 z)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 B4="Invalid date input, must be YYYY-MM-DD format and a reasonable date.";function H4(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 g.string().refine(H4,{error:B4}).describe(e)}var Ld=g.object({start_at:we("The start date of the period."),end_at:we("The end date of the period.").optional(),amount:g.number().min(0).describe("The amount of the period.")});var J4=`
363
+ `,description:"Learn how to use VQL when querying Resource Reports in Vantage.",title:"VQL for Resource Reports"}]]));var x0="2.6.7";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])=>{l!=null&&i.searchParams.append(u,Array.isArray(l)?l.join(","):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 z=class{constructor(t){this.exception=t}};var lv=new Map;function I(e){let t=(r,o)=>{r.registerTool(e.name,{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 z)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 B4="Invalid date input, must be YYYY-MM-DD format and a reasonable date.";function H4(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 g.string().refine(H4,{error:B4}).describe(e)}var Ld=g.object({start_at:we("The start date of the period."),end_at:we("The end date of the period.").optional(),amount:g.number().min(0).describe("The amount of the period.")});var J4=`
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",description:J4,annotations:{destructive:!1,openWorld:!1,readOnly:!1},args:{name:g.string().min(1).describe("The name of the Budget."),workspace_token:g.string().optional().describe("The token of the Workspace to add the Budget to."),cost_report_token:g.string().optional().describe("The CostReport token. Ignored for hierarchical Budgets."),child_budget_tokens:g.array(g.string()).optional().describe("The tokens of any child Budgets when creating a hierarchical Budget."),periods:g.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 z({errors:r.errors});return r.data}});var E0=Ue(Ge());var YU=`