Skip to main content
Glama
IDEA-Research

DINO-X Image Detection MCP Server

detect-all-objects

Analyze images to detect, count, and locate all objects with detailed descriptions using the DINO-X Image Detection MCP Server.

Instructions

Analyze an image to detect all identifiable objects, returning the category, count, coordinate positions and detailed descriptions for each object.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
imageFileUriYesURI of the input image. Preferred for remote or local files. Must start with 'https://' or 'file://'.
includeDescriptionYesWhether to return a description of the objects detected in the image, but will take longer to process.

Implementation Reference

  • Core handler implementation in DinoXApiClient that performs the actual API call to DINO-X service for detecting all objects using a universal prompt.
    async detectAllObjects(
      imageFileUri: string,
      includeDescription: boolean
    ): Promise<DetectionResult> {
      return this.performDetection(imageFileUri, includeDescription, {
        model: "DINO-X-1.0",
        prompt: {
          type: "universal",
          universal: 1
        },
        targets: ["bbox"],
        bbox_threshold: 0.25,
        iou_threshold: 0.8
      });
    }
  • Registers the 'detect-all-objects' tool in the STDIO MCP server, including input schema (Zod) and execution handler that calls the DinoXApiClient.
    private registerDetectAllObjectsTool(): void {
      const { name, description } = ToolConfigs[Tool.DETECT_ALL_OBJECTS];
      this.server.tool(
        name,
        description,
        {
          imageFileUri: z.string().describe("URI of the input image. Preferred for remote or local files. Must start with 'https://' or 'file://'."),
          includeDescription: z.boolean().describe("Whether to return a description of the objects detected in the image, but will take longer to process."),
        },
        async (args) => {
          try {
            const { imageFileUri, includeDescription } = args;
    
            if (!imageFileUri) {
              return {
                content: [
                  {
                    type: 'text',
                    text: 'Image file URI is required',
                  },
                ],
              }
            }
    
            const { objects } = await this.api.detectAllObjects(imageFileUri, includeDescription);
            const categories: ResultCategory = {};
    
            for (const object of objects) {
              if (!categories[object.category]) {
                categories[object.category] = [];
              }
              categories[object.category].push(object);
            }
    
            const objectsInfo = objects.map(obj => {
              const bbox = parseBbox(obj.bbox);
              return {
                name: obj.category,
                bbox,
                ...(includeDescription ? {
                  description: obj.caption,
                } : {}),
              }
            });
    
            return {
              content: [
                {
                  type: "text",
                  text: `Objects detected in image: ${Object.keys(categories).map(cat =>
                    `${cat} (${categories[cat].length})`
                  )?.join(', ')}.`
                },
                {
                  type: "text",
                  text: `Detailed object detection results: ${JSON.stringify(objectsInfo, null, 2)}`
                },
                {
                  type: "text",
                  text: `Note: The bbox coordinates are in [xmin, ymin, xmax, ymax] format, where the origin (0,0) is at the top-left corner of the image. These coordinates help determine the exact position and spatial relationships of objects in the image.`
                },
              ]
            };
          } catch (error) {
            return {
              content: [
                {
                  type: 'text',
                  text: `Failed to detect objects from image: ${error instanceof Error ? error.message : String(error)}`,
                },
              ],
            };
          }
        }
      )
    }
  • Registers the 'detect-all-objects' tool in the HTTP MCP server, including input schema (Zod) and execution handler that calls the DinoXApiClient.
    private registerDetectAllObjectsTool(): void {
      const { name, description } = ToolConfigs[Tool.DETECT_ALL_OBJECTS];
      this.server.tool(
        name,
        description,
        {
          imageFileUri: z.string().describe("URI of the input image. Preferred for remote or local files. Must start with 'https://'."),
          includeDescription: z.boolean().describe("Whether to return a description of the objects detected in the image, but will take longer to process."),
        },
        async (args) => {
          try {
            const { imageFileUri, includeDescription } = args;
    
            if (!imageFileUri) {
              return {
                content: [
                  {
                    type: 'text',
                    text: 'Image file URI is required',
                  },
                ],
              }
            }
    
            const { objects } = await this.api.detectAllObjects(imageFileUri, includeDescription);
            const categories: ResultCategory = {};
    
            for (const object of objects) {
              if (!categories[object.category]) {
                categories[object.category] = [];
              }
              categories[object.category].push(object);
            }
    
            const objectsInfo = objects.map(obj => {
              const bbox = parseBbox(obj.bbox);
              return {
                name: obj.category,
                bbox,
                ...(includeDescription ? {
                  description: obj.caption,
                } : {}),
              }
            });
    
            return {
              content: [
                {
                  type: "text",
                  text: `Objects detected in image: ${Object.keys(categories).map(cat =>
                    `${cat} (${categories[cat].length})`
                  )?.join(', ')}.`
                },
                {
                  type: "text",
                  text: `Detailed object detection results: ${JSON.stringify(objectsInfo, null, 2)}`
                },
                {
                  type: "text",
                  text: `Note: The bbox coordinates are in [xmin, ymin, xmax, ymax] format, where the origin (0,0) is at the top-left corner of the image. These coordinates help determine the exact position and spatial relationships of objects in the image.`
                },
              ]
            };
          } catch (error) {
            return {
              content: [
                {
                  type: 'text',
                  text: `Failed to detect objects from image: ${error instanceof Error ? error.message : String(error)}`,
                },
              ],
            };
          }
        }
      )
  • Tool schema definition: name and description used across registrations.
    [Tool.DETECT_ALL_OBJECTS]: {
      name: Tool.DETECT_ALL_OBJECTS,
      description: "Analyze an image to detect all identifiable objects, returning the category, count, coordinate positions and detailed descriptions for each object.",
    },
  • Helper utility to parse bounding box array [xmin,ymin,xmax,ymax] into named object, used in tool response formatting.
    export const parseBbox = (bbox: number[]) => {
      return {
        xmin: parseFloat(bbox[0].toFixed(1)),
        ymin: parseFloat(bbox[1].toFixed(1)),
        xmax: parseFloat(bbox[2].toFixed(1)),
        ymax: parseFloat(bbox[3].toFixed(1))
      };
    };
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that including descriptions 'will take longer to process,' which adds some context about performance impact. However, it doesn't address other important behavioral aspects like error handling, rate limits, authentication requirements, or what happens with invalid inputs, which are significant gaps for a tool with no annotation coverage.

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 efficiently conveys the tool's purpose, action, and output without any redundant information. It's appropriately sized and front-loaded, with every word serving a clear purpose in explaining what the tool does.

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?

Given the tool's moderate complexity (image analysis with 2 parameters), no annotations, and no output schema, the description is partially complete. It clearly states what the tool does and what it returns, but lacks details on behavioral traits, error conditions, and output format specifics. The absence of an output schema means the description should ideally explain return values more thoroughly, which it doesn't do beyond listing output categories.

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 description coverage is 100%, so the schema already fully documents both parameters (imageFileUri and includeDescription). The description adds minimal value beyond the schema by briefly mentioning that includeDescription affects processing time, but doesn't provide additional syntax, format details, or usage context for the parameters. This meets the baseline expectation when schema coverage is high.

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 specific action ('Analyze an image to detect all identifiable objects') and distinguishes it from siblings by emphasizing 'all identifiable objects' rather than specific types like human poses or text-based detection. It provides the verb+resource+scope combination that makes the purpose unambiguous.

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?

The description provides no guidance on when to use this tool versus the sibling tools (detect-human-pose-keypoints, detect-objects-by-text, visualize-detection-result). It doesn't mention alternatives, exclusions, or specific contexts where this tool is preferred over others, leaving the agent with no comparative usage information.

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/IDEA-Research/DINO-X-MCP'

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