Skip to main content
Glama

YNAB MCP Server

by calebl
getCategory.js1.12 kB
#!/usr/bin/env node async function getCategory(budgetId, categoryId) { try { if (!process.env.YNAB_API_TOKEN) { throw new Error("YNAB_API_TOKEN environment variable is not set"); } const response = await fetch( `https://api.ynab.com/v1/budgets/${budgetId}/categories/${categoryId}`, { headers: { 'Authorization': `Bearer ${process.env.YNAB_API_TOKEN}` } } ); if (!response.ok) { const error = await response.json(); throw new Error(error.error.detail || 'Failed to fetch category'); } const data = await response.json(); console.log("Category Details:"); console.log(JSON.stringify(data.data.category, null, 2)); return data.data.category; } catch (error) { console.error("Error fetching category:", error.message); process.exit(1); } } // Get command line arguments const args = process.argv.slice(2); if (args.length !== 2) { console.error("Usage: node getCategory.js <budgetId> <categoryId>"); process.exit(1); } const [budgetId, categoryId] = args; getCategory(budgetId, categoryId);

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/calebl/ynab-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server