Skip to main content
Glama

Get a component’s source

get_component_source
Read-only

Retrieve any encode-ui component's full source or demo code, including all imported files, as readable text.

Instructions

Every TSX file one component ships, or its demo usage example, in fenced code blocks. A multi-file component returns ALL of its files — the public module plus every sibling it imports (.parts.tsx pairs, block modules) — because the entry file alone does not compile. Check sourceBytes/demoBytes on get_component first if size matters. Returns code as text rather than a JSON field, so it stays readable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesComponent slug, e.g. magnetic-button. A leading scope prefix is accepted and ignored.
partNoWhich payload: the component source, or its demo usage example.source
Behavior4/5

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

Annotations only say read-only/open-world. The description adds valuable behavioral details: output is fenced code blocks, multi-file components return ALL sibling files, and it returns text rather than JSON for readability. This goes beyond the annotations and sets correct expectations without contradicting them.

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?

Three sentences, each earning its place: what is returned, why multi-file works, and a caution about size plus output format. No wasted words, front-loaded with purpose.

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

Completeness4/5

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

With no output schema, the description sufficiently explains the return format (fenced code blocks, text) and the notable multi-file behavior. The size check tip provides operational context. It could mention error handling or whether file paths are included, but for a simple read operation it is fairly 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?

The schema already covers both parameters with 100% description coverage (name as slug, part enum with source/demo). The description only loosely references the demo payload and doesn't add parameter-specific semantics beyond what the schema provides, so it stays at the baseline of 3.

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 title 'Get a component's source' and description make clear that this tool returns the TSX source files for a component or its demo example. It also distinguishes itself from sibling get_component by referencing sourceBytes/demoBytes and noting it returns actual code as fenced blocks, not a JSON field.

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 description gives actionable guidance: 'Check sourceBytes/demoBytes on get_component first if size matters' explicitly directs when to use the alternative tool. It also explains why multi-file components return all files (entry alone won't compile), implying a use case for full source retrieval. However, it doesn't explicitly state when NOT to use this tool beyond the size consideration.

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/reuvenaor/encode-ui'

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