Skip to main content
Glama
mhajder

Ghostfolio MCP Server

by mhajder

Upsert Asset Profile

upsert_asset_profile
Idempotent

Create or update a Ghostfolio asset profile with symbol, name, currency, and asset class, then apply optional metadata like country and sector allocations. Ensures the profile matches your input after each call.

Instructions

Create-or-update an asset profile.

POSTs an empty profile-data record (idempotent — Ghostfolio answers HTTP 400 "already exists" when the profile is already there, and HTTP 500 on some first-time-create paths while still persisting the record, so this tolerates both). Then PATCHes metadata (name, currency, asset class, optional sub-class, optional country and sector allocations). PATCH is the source of truth — if the profile doesn't exist after the POST, PATCH will surface the error. Calling twice with the same input yields the same end state.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesHuman-readable name for the asset
symbolYesSymbol/ticker of the asset. Permanent — renaming orphans associated activities and market data
sectorsNoOptional sector allocation. Entries must contain exactly 'name' and 'weight' (a fraction between 0 and 1, e.g. 0.2431); any extra key is rejected with HTTP 400. Omit to leave the stored value untouched; pass [] to reset (on 'MANUAL' this empties the list, on fetched sources it drops the override and the data provider's own sectors apply again)
currencyYesCurrency code of the asset (e.g., 'USD', 'CHF', 'EUR')
countriesNoOptional country allocation. Entries must contain exactly 'code' (ISO 3166-1 alpha-2, e.g. 'US') and 'weight' (a fraction between 0 and 1, e.g. 0.6907) — any extra key, such as the 'continent' and 'name' that reads add, is rejected with HTTP 400. Omit to leave the stored value untouched; pass [] to reset (on 'MANUAL' this empties the list, on fetched sources it drops the override and the data provider's own countries apply again)
asset_classYesAsset class: 'EQUITY', 'FIXED_INCOME', 'REAL_ESTATE', 'COMMODITY', 'LIQUIDITY' (cash), or 'ALTERNATIVE_INVESTMENT'. Note: Ghostfolio's enum does not include 'CASH' — use 'LIQUIDITY'
data_sourceYesData source for the symbol. Typically 'MANUAL' — Ghostfolio rejects profile-data writes for auto-fetched sources
asset_sub_classNoOptional asset sub-class (e.g., 'MUTUALFUND', 'CASH', 'ETF')

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.7.0
    • addedInput schema / properties / countries
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Optional country allocation. Entries must contain exactly 'code' (ISO 3166-1 alpha-2, e.g. 'US') and 'weight' (a fraction between 0 and 1, e.g. 0.6907) — any extra key, such as the 'continent' and 'name' that reads add, is rejected with HTTP 400. Omit to leave the stored value untouched; pass [] to reset (on 'MANUAL' this empties the list, on fetched sources it drops the override and the data provider's own countries apply again)"
      +}
    • addedInput schema / properties / sectors
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Optional sector allocation. Entries must contain exactly 'name' and 'weight' (a fraction between 0 and 1, e.g. 0.2431); any extra key is rejected with HTTP 400. Omit to leave the stored value untouched; pass [] to reset (on 'MANUAL' this empties the list, on fetched sources it drops the override and the data provider's own sectors apply again)"
      +}
  2. First observedv1.5.0

TDQS

A4.7/5.0
Behavior5/5

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

Beyond annotations, the description discloses concrete error tolerance (HTTP 400 when already exists, HTTP 500 on some first-time paths while still persisting), the POST-then-PATCH flow, and that PATCH is the source of truth. This level of detail prevents an agent from misinterpreting non-standard idempotency behavior.

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 appropriately dense for the complexity of an idempotent upsert with non-standard HTTP behavior. Every sentence carries information: purpose, POST behavior, PATCH source-of-truth, and end-state guarantee. No filler or redundant schema repetition.

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

Completeness5/5

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

For an 8-paramt tool with a 100%-covered schema, annotations, and an output schema, the description covers the only real gaps: the two-step operation, edge-case error handling, and idempotency guarantees. Nothing an agent needs to correctly invoke this tool is missing.

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

Parameters4/5

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

Input schema coverage is 100%, so baseline is 3. The description adds meaningful flow context by stating that the POST creates an empty profile and the PATCH applies metadata parameters, and that PATCH errors surface if the POST did not persist. This goes beyond simply echoing parameter names.

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?

The description opens with a specific verb+resource ('Create-or-update an asset profile') and clarifies the two-step POST/PATCH mechanism. This clearly distinguishes it from the sibling get_asset_profile and delete_asset_profile tools.

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

Usage Guidelines4/5

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

The 'Create-or-update' framing gives a clear context for when to call it, and the idempotent behavior explains repeated-invocation safety. It does not explicitly name alternatives or exclusions, but the sibling names and the verb make the intended use unambiguous.

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