Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions mcp-server/src/tools/screen-tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,17 @@ export const screenTools = [
required: ["screenId"],
},
},
{
name: "get_screen_code",
description: "Get the source HTML for a screen that was created with code (via create_screen, batch_create_screens, update_screen_image, or Figma paste). Returns hasCode:false when the screen has no stored source (e.g., uploaded image or blank screen).",
inputSchema: {
type: "object",
properties: {
screenId: { type: "string", description: "ID of the screen" },
},
required: ["screenId"],
},
},
{
name: "update_screen_image",
description: "Re-render a screen's image from new HTML content. Use inline styles only (no <style> tags).",
Expand Down Expand Up @@ -227,6 +238,7 @@ export async function handleScreenTool(name, args, state, renderer) {
y: s.y,
hotspotCount: (s.hotspots || []).length,
hasImage: !!s.imageData,
hasCode: !!s.sourceHtml,
description: s.description || "",
status: s.status || "new",
tbd: s.tbd || false,
Expand Down Expand Up @@ -291,6 +303,18 @@ export async function handleScreenTool(name, args, state, renderer) {
return { __contentBlocks: content };
}

case "get_screen_code": {
const screen = state.getScreen(args.screenId);
if (!screen) throw new Error(`Screen not found: ${args.screenId}`);
return {
screenId: screen.id,
name: screen.name,
hasCode: !!screen.sourceHtml,
sourceHtml: screen.sourceHtml,
figmaSource: screen.figmaSource,
};
}

case "update_screen_image": {
const screen = state.getScreen(args.screenId);
if (!screen) throw new Error(`Screen not found: ${args.screenId}`);
Expand Down
Loading