Skip to main content
Glama
bkichler

monarch-mcp

by bkichler

create_tag

Create a new tag with a specified name and color to organize and categorize your personal finances.

Instructions

Create a new tag. Color is a hex string like '#ff0000'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
colorYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'create_tag' tool. It is decorated with @mcp.tool() to register it as an MCP tool, accepts 'name' (str) and 'color' (str) parameters, obtains an authenticated MonarchMoney client, and delegates to the upstream library's create_transaction_tag method.
    @mcp.tool()
    async def create_tag(name: str, color: str) -> dict[str, Any]:
        """Create a new tag. Color is a hex string like '#ff0000'."""
        client = await _get_client()
        return await client.create_transaction_tag(name=name, color=color)
  • The @mcp.tool() decorator on line 140 registers 'create_tag' as a tool in the FastMCP server instance (line 31: mcp = FastMCP('monarch-mcp')).
    @mcp.tool()
    async def create_tag(name: str, color: str) -> dict[str, Any]:
  • Input schema: the tool accepts two string parameters: 'name' (the tag name) and 'color' (a hex color string like '#ff0000'). Return type is dict[str, Any].
    async def create_tag(name: str, color: str) -> dict[str, Any]:
  • Helper function that returns an authenticated MonarchMoney client instance, used by the create_tag handler to make the API call.
    async def _get_client() -> MonarchMoney:
        """Return a logged-in MonarchMoney client, reusing the session pickle."""
        global _client
        if _client is not None:
            return _client
        async with _login_lock:
            if _client is not None:
                return _client
            SESSION_DIR.mkdir(parents=True, exist_ok=True)
            client = MonarchMoney(session_file=str(SESSION_FILE))
            if SESSION_FILE.exists():
                try:
                    client.load_session(str(SESSION_FILE))
                    _client = client
                    return _client
                except Exception:
                    pass  # fall through to fresh login
            email, password, mfa_secret = auth.require_login_credentials()
            try:
                await client.login(
                    email=email,
                    password=password,
                    use_saved_session=False,
                    save_session=True,
                    mfa_secret_key=mfa_secret,
                )
            except RequireMFAException as exc:
                raise RuntimeError(
                    "Monarch requires MFA but no TOTP secret is stored. "
                    "Re-run `monarch-mcp-setup set` and provide the MFA secret."
                ) from exc
            _client = client
            return _client
Behavior3/5

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

Provides color format example but no annotations; lacks info on error behavior, uniqueness, or return value beyond the output schema existence.

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?

Two sentences are direct and contain no extraneous information.

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

Completeness4/5

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

With a simple parameter set and output schema present, the description covers the main purpose and color format; could mention constraints but adequate for basic use.

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?

Adds meaning for the 'color' parameter with a hex string example, but the 'name' parameter is not elaborated beyond schema, and schema coverage is 0%.

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

Purpose5/5

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

Clearly states it creates a new tag, distinguishing it from sibling tools like list_tags and create_category.

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?

No guidance on when to use this tool vs alternatives, such as when to create a category instead.

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

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/bkichler/monarch-mcp'

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