Skip to main content
Glama
Meh-S-Eze

MCP YNAB Server

cache_categories

Store all YNAB categories for a specific budget ID using the Model Context Protocol, enabling efficient access and management of budget data.

Instructions

Cache all categories for a given YNAB budget ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
budget_idYes

Implementation Reference

  • The handler function for the 'cache_categories' MCP tool. It fetches all categories from the YNAB API for the given budget_id and caches them using the helper method. Registered via @mcp.tool() decorator.
    @mcp.tool()
    async def cache_categories(budget_id: str) -> str:
        """Cache all categories for a given YNAB budget ID."""
        async with await get_ynab_client() as client:
            categories_api = CategoriesApi(client)
            response = categories_api.get_categories(budget_id)
            groups = response.data.category_groups
            categories = []
            for group in groups:
                if isinstance(group, CategoryGroupWithCategories):
                    categories.extend(group.categories)
    
            ynab_resources.cache_categories(budget_id, [cat.to_dict() for cat in categories])
            return f"Categories cached for budget ID {budget_id}"
  • Helper method in the YNABResources class that persists the categories to a JSON cache file for the specified budget_id.
    def cache_categories(self, budget_id: str, categories: List[Dict[str, Any]]) -> None:
        """Cache categories for a budget ID."""
        self._category_cache[budget_id] = [
            {
                "id": cat.get("id"),
                "name": cat.get("name"),
                "group": cat.get("category_group_name"),
            }
            for cat in categories
        ]
        _save_json_file(BUDGET_CATEGORY_CACHE_FILE, self._category_cache)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While 'cache' implies a write operation that stores data locally, the description doesn't specify what 'cache' means operationally - whether this is persistent storage, memory caching, duration, or side effects. It also doesn't mention authentication requirements, rate limits, or what happens on repeated calls.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core action and gets straight to the point without unnecessary elaboration or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations, no output schema, and low schema coverage, the description is insufficient. It doesn't explain what 'caching' means in this context, what the tool actually returns (if anything), how the cached data can be used, or why one would cache categories rather than using 'get_categories' directly. The description leaves too many operational questions unanswered.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description mentions 'budget ID' which aligns with the single parameter in the schema, but with 0% schema description coverage, it doesn't add meaningful semantic context beyond what's obvious from the parameter name. It doesn't explain what format the budget ID should be, where to find it, or provide examples. The baseline is 3 since schema coverage is low but the description doesn't adequately compensate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Cache all categories') and the target resource ('for a given YNAB budget ID'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from sibling 'get_categories' which likely retrieves categories without caching, leaving some ambiguity about differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_categories' or when caching is appropriate versus direct retrieval. There's no mention of prerequisites, timing considerations, or performance implications that would help an agent decide when this tool is the right choice.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

Latest Blog Posts

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/Meh-S-Eze/ynab-mcp-client2'

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