get_code_connect_map (MCP): silent empty map is indistinguishable from wrong fileKey / timeout — return distinguishable errors

Offen
#407 0 Kommentare 3 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
45/100
Issue-Typ
Feature
Klarheit
Klar beschrieben
Aktivitätsstatus
Ruhig
Tech-Stack
typescript
Bereich
api, backend

Rechercherichtung

Start by tracing the get_code_connect_map MCP tool and how it represents empty results and lookup timeouts; the issue names no files or tests. Identify where the file lookup and timeout outcomes are handled, then add distinguishable machine-readable results or errors for those cases while preserving a genuine empty map. Done means MCP clients can tell all three outcomes apart; add or update coverage for each case.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Feature request

get_code_connect_map (Figma MCP) currently returns an empty map {} with success semantics in at least three distinct situations:

  1. The queried fileKey has no published Code Connect — typically because the caller passed the fileKey of a design file that instantiates the components, rather than the library file the mappings were published against. Response: bare {}.
  2. The node genuinely has no mappings. Response: bare {}.
  3. The backend lookup timed out — e.g. when the queried node is too broad (page/document root on a large file). Response: {} plus only a prose note appended to the result: "Note: the Code Connect lookup timed out, so this response may be missing Code Connect data." (reproduced 2/2).

For MCP clients — especially agents — 1 and 3 are indistinguishable from 2. The practical failure mode is an agent confidently concluding "this component has no Code Connect mapping" and writing that into downstream code or docs, when the mappings exist and the call was merely mis-scoped or timed out. Since passing a design-file key is the natural first attempt (it's the fileKey the caller is holding), case 1 is the default path for anyone who doesn't already know the library fileKey.

Request: make the outcomes distinguishable. Any of these would work for MCP clients:

  • an error (or MCP tool error result) for "this file has no Code Connect published" and for "lookup timed out", or
  • a machine-readable status field alongside the map (ok / no_code_connect_for_file / timeout_partial), keeping {} only for a genuine empty result.

Scope note: I'm aware #284 was routed away as an MCP-server issue, but #373 (MCP response shape) was fixed via this repo, so filing here for the paper trail — happy to move this to the right channel if there is one.

Related, not duplicates: #340 (MCP silently ignores Angular mappings), #292 (placeholder snippets), forum threads 42405 and 56495 (empty/partial maps with different root causes — those are about missing entries, this one is about failure modes being unsignaled).

Vorherrschende Sprache
TypeScript
Sterne
1.6k
Forks
126
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus figma/code-connect

Alle Issues in figma/code-connect

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.