Skip to main content
Glama
thehzuo

web-gui-mcp

by thehzuo

search_artifact_patterns

Search for artifact patterns using a natural language query and filter by use case to quickly find design templates, code patterns, or visual components.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
patternsYes

Implementation Reference

  • Handler function for search_artifact_patterns tool. Delegates to search_patterns() from registry.
    def search_artifact_patterns_handler(
        input_data: SearchArtifactPatternsInput,
    ) -> SearchArtifactPatternsOutput:
        return SearchArtifactPatternsOutput(
            patterns=search_patterns(
                query=input_data.query,
                use_case=input_data.use_case,
                max_results=input_data.max_results,
            )
        )
  • MCP tool registration of search_artifact_patterns via @mcp.tool() decorator.
    def register_tools(mcp: Any, store: MemoryArtifactStore) -> None:
        @mcp.tool()
        def search_artifact_patterns(
            input: SearchArtifactPatternsInput,
        ) -> SearchArtifactPatternsOutput:
            return search_artifact_patterns_handler(input)
  • Input schema for search_artifact_patterns: query, use_case (optional), max_results.
    class SearchArtifactPatternsInput(ToolBaseModel):
        query: str = ""
        use_case: Literal[
            "planning",
            "code_review",
            "code_understanding",
            "design",
            "design_system",
            "prototyping",
            "diagrams",
            "decks",
            "research",
            "reports",
            "editor",
        ] | None = None
        max_results: int = Field(default=5, ge=1, le=20)
  • Output schema for search_artifact_patterns: list of PatternSummary objects.
    class SearchArtifactPatternsOutput(ToolBaseModel):
        patterns: list[PatternSummary]
  • Core search logic: filters PATTERNS dict by use_case and keyword query, returns up to max_results summaries.
    def search_patterns(query: str = "", use_case: str | None = None, max_results: int = 5) -> list[PatternSummary]:
        terms = query.casefold().split()
        results: list[ArtifactPattern] = []
        for pattern in PATTERNS.values():
            if use_case and pattern.use_case != use_case:
                continue
            haystack = " ".join(
                [pattern.id, pattern.name, pattern.description, pattern.use_case, *pattern.best_for]
            ).casefold()
            if terms and not all(term in haystack for term in terms):
                continue
            results.append(pattern)
        return [pattern.summary() for pattern in results[:max_results]]
Behavior1/5

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

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

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

Completeness1/5

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

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

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

Usage Guidelines1/5

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

Tool has no description.

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/thehzuo/gui-mcp'

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