vantage-mcp-server 2.6.3 → 2.6.4

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 k0="2.6.3";var cv={name:"Vantage Cloud Costs Helper",version:k0};async function x0(e,t,r,o,n){t["User-Agent"]=`vantage-mcp-server/${cv.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 E=class{constructor(t){this.exception=t}};var uv=new Map;function O(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 E)return{content:[{type:"text",text:JSON.stringify(i.exception,null,2)}],isError:!0};throw i}})};if(uv.has(e.name))throw new Error(`Tool ${e.name} is already registered`);return uv.set(e.name,t),e}function S0(e,t){for(let r of uv.values())r(e,t)}var Z4="Invalid date input, must be YYYY-MM-DD format and a reasonable date.";function V4(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(V4,{error:Z4}).describe(e)}var F4=`
363
+ `,description:"Learn how to use VQL when querying Resource Reports in Vantage.",title:"VQL for Resource Reports"}]]));var k0="2.6.4";var cv={name:"Vantage Cloud Costs Helper",version:k0};async function x0(e,t,r,o,n){t["User-Agent"]=`vantage-mcp-server/${cv.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 E=class{constructor(t){this.exception=t}};var uv=new Map;function O(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 E)return{content:[{type:"text",text:JSON.stringify(i.exception,null,2)}],isError:!0};throw i}})};if(uv.has(e.name))throw new Error(`Tool ${e.name} is already registered`);return uv.set(e.name,t),e}function S0(e,t){for(let r of uv.values())r(e,t)}var Z4="Invalid date input, must be YYYY-MM-DD format and a reasonable date.";function V4(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(V4,{error:Z4}).describe(e)}var F4=`
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(),W4=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.")}),P5=O({name:"create-budget",description:F4,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(W4).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 E({errors:r.errors});return r.data}});var G4=`