Skip to main content
Glama

get_build_details

Retrieve complete component list, prices, compatibility, and estimated power consumption for a specific PC build using its ID.

Instructions

Detalhes de uma build específica: lista completa de componentes, preços, compatibilidade e consumo estimado

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
build_idYesID da build (ex: 'oI7mI7', extraído da URL /build/{id})

Implementation Reference

  • Main handler function that fetches build details from meupc.net, parses the HTML to extract title, author, compatibility notes, consumption, components, and prices, then returns a JSON string.
    export async function getBuildDetails(params: GetBuildDetailsParams): Promise<string> {
      const { build_id } = params;
    
      const root = await fetchPage(`/build/${build_id}`);
    
      // Título — pode ser genérico ("PC montado (Build)") ou customizado
      const title = root.querySelector("h1.title")?.text.trim() || "Build";
    
      // Autor — buscar no conteúdo da página
      const authorEl = root.querySelector("p.by a.has-text-weight-semibold, a[href*='/perfil/']");
      const author = authorEl?.text.trim() || null;
    
      // Compatibilidade / observações
      const compatNotes: string[] = [];
      root.querySelectorAll("article.message div.message-body ul li").forEach(li => {
        const note = li.text.trim();
        if (note) compatNotes.push(note);
      });
    
      // Consumo estimado
      const consumption = root.querySelector("div.consumption strong")?.text.trim() || null;
    
      // Componentes da build — iterar por <tr> individual (não por <tbody>)
      // pois múltiplos itens do mesmo tipo (ex: 2 pentes de RAM) ficam
      // em <tr> separados dentro do mesmo <tbody>
      const components: BuildComponent[] = [];
    
      root.querySelectorAll("table.table.is-body-striped tbody:not(.table-responsive-totals) tr").forEach(row => {
        // Tipo do componente (ex: "Processador", "Placa de vídeo")
        const type = row.querySelector("th.table-responsive-title a")?.text.trim()
          || row.querySelector("th.table-responsive-title")?.text.trim()
          || "";
        if (!type) return;
    
        // Nome do componente (normalizar whitespace interno)
        const nameEl = row.querySelector("td.table-responsive-selection a.has-text-strong");
        const name = nameEl?.text.trim().replace(/\s+/g, " ") ?? "";
        if (!name) return;
    
        const componentUrl = nameEl?.getAttribute("href") ?? null;
    
        // Preço — tentar PIX (bold) primeiro, depois normal (medium)
        const pixText = row.querySelector("td.table-responsive-price a.has-text-weight-bold.has-text-success")?.text.trim() ?? "";
        const normalText = row.querySelector("td.table-responsive-price a.has-text-weight-medium.has-text-success")?.text.trim() ?? "";
        const price = parsePrice(pixText) ?? parsePrice(normalText);
    
        components.push({
          type,
          name,
          price,
          url: componentUrl ? absoluteUrl(componentUrl) : null,
        });
      });
    
      // Totais
      let totalPrice: number | null = null;
      let totalPricePix: number | null = null;
    
      root.querySelectorAll("tbody.table-responsive-totals tr").forEach(row => {
        const text = row.text;
        const priceCells = row.querySelectorAll("td.has-text-right");
        const priceCell = priceCells.length > 0 ? priceCells[priceCells.length - 1].text.trim() : "";
    
        if (text.includes("Total no PIX") || text.includes("Total PIX")) {
          totalPricePix = parsePrice(priceCell);
        } else if (text.includes("Total") && !text.includes("Desconto")) {
          totalPrice = parsePrice(priceCell);
        }
      });
    
      const result: BuildDetails & {
        totalPricePix: number | null;
        compatibility: string[];
        consumption: string | null;
      } = {
        title,
        author,
        totalPrice: totalPricePix ?? totalPrice,
        likes: null, // Não disponível na página de detalhes
        components,
        url: absoluteUrl(`/build/${build_id}`),
        totalPricePix,
        compatibility: compatNotes,
        consumption,
      };
    
      return JSON.stringify(result, null, 2);
    }
  • Zod schema defining the input parameter: build_id (string) — extracted from URL /build/{id}.
    export const getBuildDetailsSchema = z.object({
      build_id: z.string().describe("ID da build (ex: 'oI7mI7', extraído da URL /build/{id})"),
    });
  • src/index.ts:61-68 (registration)
    Registration of the 'get_build_details' tool on the MCP server with its schema and handler callback.
    server.tool(
      "get_build_details",
      "Detalhes de uma build específica: lista completa de componentes, preços, compatibilidade e consumo estimado",
      getBuildDetailsSchema.shape,
      async (params) => ({
        content: [{ type: "text", text: await getBuildDetails(params) }],
      })
    );
  • BuildDetails and BuildComponent interfaces used as return types for the get_build_details handler.
    export interface BuildDetails {
      title: string;
      author: string | null;
      totalPrice: number | null;
      likes: number | null;
      components: BuildComponent[];
      url: string;
    }
    
    export interface BuildComponent {
      type: string;
      name: string;
      price: number | null;
      url: string | null;
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden of behavioral disclosure. It describes what the tool returns but does not state that the operation is read-only, nor mention authentication or rate limits. The description lacks essential safety cues.

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?

The description is a single, well-structured sentence that front-loads the tool's purpose and lists key information included in the output. No wasted words.

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?

Considering no output schema, the description adequately explains the return content (components, prices, compatibility, consumption). It misses some details like format or optional filtering, but for a simple retrieval tool it is reasonably 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 schema already describes the parameter effectively. The tool description does not add information about the parameter beyond what is in the schema, so a baseline of 3 is appropriate.

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 provides details of a specific build, listing components, prices, compatibility, and estimated consumption. This is distinct from sibling tools like list_community_builds (multiple builds) and get_component_details (single component).

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

Usage Guidelines2/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 tool versus alternatives. The description does not indicate that this is for a single build or exclude cases where other tools are more appropriate (e.g., searching builds vs. retrieving one).

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/leosebben/mcp-meupc'

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