Skip to content

Tools ​

The Flat MCP server exposes four tools. Their names are stable. Every result is returned both as structuredContent and as JSON text in content[0].text.

ToolTitleAnnotations
searchSearchread-only, idempotent
score_getScore: Get Detailsread-only, idempotent
score_exportScore: Export Notationread-only, idempotent
score_createScore: Createwrite, not idempotent

All tools act on the connected customer's own account only.

Search the customer's own scores and collections. Use it to find something the customer refers to before acting on it.

Input

ParameterTypeRequiredDescription
querystring, max 500yesNatural-language or keyword search. Matches titles, composers, instrumentation and content
contentTypesarray of scores, collectionsnoDefaults to both
limitinteger, 1-50noDefaults to 20

Output

json
{
  "totalHits": 2,
  "results": [
    {
      "type": "score",
      "id": "...",
      "title": "Nocturne in E flat",
      "url": "https://flat.io/score/...",
      "composer": "Frédéric Chopin",
      "modificationDate": "2026-10-06T08:12:00.000Z",
      "instruments": ["piano"],
      "collaborators": 0
    }
  ]
}

Every result has a type (score or collection). No match is a successful empty result.

score_get ​

Get the descriptive details of one score. Returns metadata only, never the notation: use score_export for the music itself.

Input

ParameterTypeRequiredDescription
scoreIdstringyesScore identifier, as returned by search or score_create

Output

id, title, composer, privacy, url, creationDate, modificationDate, instruments, instrumentsNames, durationTime (seconds), numberMeasures and collaborators (a count).

score_export ​

Get the notation of a score.

Input

ParameterTypeRequiredDescription
scoreIdstringyesScore identifier
revisionIdstringnoDefaults to the latest revision
formatmusicxml, mxl, midinoDefaults to musicxml
inlinebooleannoFor midi only: return the file inline instead of a URL

Delivery

  • musicxml and mxl are always returned inline. musicxml is UTF-8 text, mxl is base64.
  • midi returns a short-lived download URL by default, or base64 inline with inline: true.
  • Inline content is capped at 256 KiB. A midi file over the cap falls back to a URL. A musicxml export over the cap fails with PAYLOAD_TOO_LARGE: retry with mxl, the same notation compressed. Content is never truncated.

Output

FieldDescription
scoreId, revisionIdThe exported score and revision
formatmusicxml, mxl or midi
deliveryinline or url
data, encodingInline content, utf-8 or base64
url, expiresAtDownload URL and its expiry, for delivery: url
sizeBytesSize of the file
notePresent when the delivery differs from the request

score_create ​

Create a new score in the customer's account from notation you provide, and return a link to it. Prefer MusicXML: it is the only format that preserves all notation detail.

Input

ParameterTypeRequiredDescription
titlestring, max 255yesTitle shown in the customer's library
formatmusicxml, mxl, midi, abc, musescore, guitarproyesFormat of data
datastring, max 20,000,000 charactersyesPlain text for musicxml and abc, base64 for the binary formats
encodingbase64for binary formatsRequired with mxl, midi, musescore and guitarpro
privacyprivate, privateLinknoDefaults to private
  • abc is converted to MusicXML on import.
  • midi keeps only pitches, timing and instruments.
  • Scores cannot be created public. A privateLink score can be opened by anyone with its link.
  • Created scores are filed in a collection dedicated to the connected client.

Output

json
{
  "status": "created",
  "id": "...",
  "title": "Morning Study",
  "url": "https://flat.io/score/...",
  "privacy": "private"
}

Large imports can still be running when the call returns. The result is then { "status": "processing", "taskId": "...", "message": "..." }, and the score appears in the customer's library when the import finishes.

Errors ​

A failed call returns a tool result with isError: true. The message is the API's, localized to the customer's language, and names the parameter at fault when there is one. The result also carries errorCode, errorParam and errorId (quote errorId when you contact us).

  • A score that does not exist and a score the customer cannot access both return the same not-found error.
  • Server-side failures return "Something went wrong on Flat's side. Try again shortly."

Rate limits ​

Requests count against the connected customer's API rate limit, per client and per customer, over a one-hour window. When it is exceeded, tools fail with API_RATE_LIMIT_EXCEEDED.

Copyright © Tutteo Limited