Skip to main content
Glama
gregkop

Sketchfab MCP Server

by gregkop

sketchfab-model-details

Retrieve comprehensive details for any Sketchfab 3D model using its unique ID, including specifications, creator information, and download options.

Instructions

Get detailed information about a specific Sketchfab model

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelIdYesThe unique ID of the Sketchfab model (found in URLs or search results)

Implementation Reference

  • The main handler function that implements the tool logic: checks for API key, instantiates SketchfabApiClient, calls getModel on the modelId, formats the result using formatModelForDisplay, and returns markdown-formatted text content or error message.
    async ({ modelId }) => {
      try {
        // Check if API key is available
        if (!apiKey) {
          return {
            content: [
              {
                type: "text",
                text: "No Sketchfab API key provided. Please provide an API key using the --api-key parameter or set the SKETCHFAB_API_KEY environment variable.",
              },
            ],
          };
        }
    
        // Create API client
        const client = new SketchfabApiClient(apiKey);
        
        // Get model details
        const model = await client.getModel(modelId);
        
        // Format model details
        const formattedModel = formatModelForDisplay(model);
        
        return {
          content: [
            {
              type: "text",
              text: formattedModel,
            },
          ],
        };
      } catch (error: unknown) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        
        return {
          content: [
            {
              type: "text",
              text: `Error getting model details: ${errorMessage}`,
            },
          ],
        };
      }
    }
  • Input schema using Zod, defining the required 'modelId' parameter as a string.
    {
      modelId: z.string().describe("The unique ID of the Sketchfab model (found in URLs or search results)"),
    },
  • index.ts:368-370 (registration)
    Tool registration via server.tool() with the tool name 'sketchfab-model-details' and description.
    server.tool(
      "sketchfab-model-details",
      "Get detailed information about a specific Sketchfab model",
  • Utility function that formats a SketchfabModel object into a human-readable string used in the tool's output.
    function formatModelForDisplay(model: SketchfabModel): string {
      const thumbnailUrl = model.thumbnails?.images?.[0]?.url || "No thumbnail";
      const username = model.user?.username || "Unknown";
      const downloadable = model.isDownloadable ? "Yes" : "No";
      
      return `
    [Model] ${model.name}
    ID: ${model.uid}
    Creator: ${username}
    Downloadable: ${downloadable}
    Thumbnail: ${thumbnailUrl}
    ${model.description ? `Description: ${model.description}` : ""}
    `;
    }
  • SketchfabApiClient method that performs the core API call to retrieve model details by UID, with error handling for not found, auth, etc.
    async getModel(uid: string): Promise<SketchfabModel> {
      try {
        const response = await axios.get(
          `${SketchfabApiClient.API_BASE}/models/${uid}`,
          {
            headers: this.getAuthHeader(),
          }
        );
        
        return response.data;
      } catch (error: unknown) {
        if (axios.isAxiosError(error) && error.response) {
          const status = error.response.status;
          if (status === 404) {
            throw new Error(`Model with UID ${uid} not found`);
          } else if (status === 401) {
            throw new Error("Invalid Sketchfab API key");
          }
          throw new Error(`Sketchfab API error (${status}): ${error.message}`);
        }
        throw error instanceof Error ? error : new Error(String(error));
      }
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.2/5.0
Behavior2/5

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

With no annotations, the description carries full burden but only says 'detailed information' without explaining what behavior to expect (e.g., does it require authentication? Are there rate limits?). It lacks behavioral context.

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?

Single sentence, 9 words, no fluff. Front-loaded with the action, efficient for a simple tool.

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

Completeness2/5

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

No output schema exists, and the description does not hint at what 'detailed information' includes (e.g., metadata, stats, file URLs). For a tool returning model details, the description should outline the scope of the response.

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 parameter description is informative. The tool description does not add additional semantic meaning beyond what the schema already provides, so baseline score 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 the action ('Get detailed information') and resource ('specific Sketchfab model'). It is distinct from sibling tools like sketchfab-search (list) and sketchfab-download (file retrieval).

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 mention prerequisites, limitations, or cases where another sibling tool would be more appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.