Skip to main content
Glama

get_screen

Retrieve metadata and details for a specific screen by providing its UUID. Optionally include full HTML source.

Instructions

Get details and metadata for a specific screen. Set include_html=true to also return the HTML source.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
screen_idYesScreen UUID returned by generate_screen or iterate_screen.
include_htmlNoInclude full HTML in response (large).

Implementation Reference

  • Handler function for the 'get_screen' tool. Calls getScreen() from storage to fetch screen metadata by ID, returns JSON with optional HTML content based on include_html flag.
    async function handleGet(input: z.infer<typeof getInput>) {
      const screen = await getScreen(input.screen_id);
      if (!screen) throw new Error(`Screen not found: ${input.screen_id}`);
      const meta = {
        id: screen.id,
        project: screen.project,
        name: screen.name,
        createdAt: screen.createdAt,
        prompt: screen.prompt,
        designSystem: screen.designSystem,
        parentId: screen.parentId,
        tokens: screen.tokens,
        model: screen.model,
        htmlPath: screen.htmlPath,
        pngPath: screen.pngPath,
      };
      const out: Array<{ type: "text"; text: string }> = [
        { type: "text", text: JSON.stringify(meta, null, 2) },
      ];
      if (input.include_html) {
        const html = await readHtml(screen);
        out.push({ type: "text", text: "```html\n" + html + "\n```" });
      }
      return { content: out };
    }
  • src/server.ts:67-71 (registration)
    Tool registration in TOOLS array with name 'get_screen', description, and inputSchema derived from the getInput Zod schema.
        name: "get_screen",
        description: "Get details and metadata for a specific screen. Set include_html=true to also return the HTML source.",
        inputSchema: zodToJson(getInput),
      },
    ];
  • Zod input schema (getInput) defining validation for screen_id (required string) and include_html (optional boolean, default false).
    const getInput = z.object({
      screen_id: z.string().describe("Screen UUID returned by generate_screen or iterate_screen."),
      include_html: z.boolean().default(false).describe("Include full HTML in response (large)."),
    });
  • Storage helper function getScreen() that reads JSON metadata files from all project directories to find a screen matching the given ID.
    export async function getScreen(id: string): Promise<SavedScreen | null> {
      // listProjects() returns directory names that are already slugged on disk.
      // Slugging them again is idempotent but misleading — read directly.
      const projects = await listProjects();
      for (const project of projects) {
        const dir = join(DESIGNS_DIR, project);
        const files = await readdir(dir).catch(() => []);
        for (const f of files) {
          if (f.endsWith(".json")) {
            const meta = JSON.parse(await readFile(join(dir, f), "utf8")) as SavedScreen;
            if (meta.id === id) return meta;
          }
        }
      }
      return null;
    }
  • src/server.ts:130-131 (registration)
    Switch-case dispatch routing the 'get_screen' tool name to handleGet() handler.
    case "get_screen":
      return await handleGet(getInput.parse(args));
Behavior3/5

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

With no annotations, the description carries the burden. It mentions the optional HTML return but does not disclose potential size impacts, pagination, or any side effects. Minimal but not misleading.

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 concise sentences that directly state the tool's purpose and key parameter option. No wasted words.

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

Completeness3/5

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

No output schema, so 'details and metadata' is vague. While the tool is simple, an agent might benefit from knowing what fields are returned. Adequate but not fully complete.

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?

Schema coverage is 100%, and the description adds minimal extra meaning beyond what the schema already states. For screen_id, it repeats the schema; for include_html, it rephrases slightly.

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 clearly states it 'get details and metadata for a specific screen,' which distinguishes it from siblings like generate_screen (create) and list_screens (list all).

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

Usage Guidelines3/5

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

No explicit guidance on when to use this versus alternatives, though sibling names imply the correct use case. The description does provide context for an optional parameter (include_html).

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/karyaboyraz/mockit-mcp'

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