Visual Primitives and Tool Calling for Multimodal Agents: A Practical Guide

    This article examines why multimodal agents often recognize objects in images but fail to reference them reliably, and compares two technical approaches: visual primitives that use structured geometric pointers, and image-based reasoning that relies on cropping tools. It covers the engineering constraints of agent harnesses, configuration best practices, a layered evaluation methodology for grounding and tool use, a troubleshooting checklist, and selection guidance for different task types. Readers will learn how to move multimodal capabilities from demo-ready to operationally maintainable.

    1. Why Multimodal Agents See but Cannot Point Accurately

    Recent technical discussions have focused on a class of experimental multimodal models that behave differently from earlier systems when handling image-related tasks inside agents. Setting aside any specific product, this points to a broadly relevant problem: when a large model is placed in an agent framework and must “look at an image, locate, count, plan, and call tools,” failures usually do not occur because the model cannot recognize an object. They occur because the model recognizes the object but cannot refer to it consistently.

    The industry typically breaks this problem into two layers:

    • Perception gap: The resolution, compression, scaling, and tiling strategy applied to the input image mean the model actually “sees” less information than the original image contains. Small objects, dense objects, and fine-grained textures are already lost during preprocessing.
    • Reference gap: Even when the model sees the content clearly, if it can only describe targets in natural language (“the cup on the left,” “the pedestrian near the edge”), the description itself is ambiguous. Subsequent reasoning and tool calls accumulate errors across multiple iterations.

    Understanding these two gaps is a prerequisite for evaluating any multimodal agent approach. Many conclusions that “the model is not good enough” actually stem from defects in preprocessing and interface design within the engineering pipeline.

    2. Comparing Two Technical Approaches

    2.1 The Visual Primitives Approach

    The core idea of visual primitives is to introduce unambiguous pointers into continuous visual space, using structured geometric objects (such as points, bounding boxes, and polygons) to directly indicate image regions instead of natural language references. The model output is no longer “that red square” but a set of parseable coordinate structures.

    Its advantages are:

    • Deterministic reference: Coordinates can be consumed directly by programs, avoiding semantic drift.
    • Easy tool loop closure: Detection results can be passed directly to external tools for cropping, scaling, distance measurement, counting, and more.
    • Measurable error: Coordinate deviation is a quantifiable metric, making regression testing straightforward.

    The cost is that both the model and the inference framework must support structured visual objects on the input and output sides, which requires significant engineering changes. It also depends heavily on geometric annotations in training data.

    2.2 The Think-with-Images Approach

    Another common approach lets the model repeatedly “look at the image, describe again, and reason again” during inference, treating the image as context that can be consulted repeatedly without introducing explicit geometric primitives. A typical implementation allows the model to output crop requests for image regions, with an external tool returning new image fragments.

    Its advantage is low engineering cost and good compatibility with existing tool-calling mechanisms. Its limitation is that it still relies on natural language for internal reference, so it is less stable on tasks such as dense counting and localization under complex occlusion.

    An observable clue for distinguishing the two: if the system’s vocabulary contains paired markers representing points, boxes, or polygons, it usually means the system retains input and output channels for structured visual objects. Otherwise, it is more likely a combination of pure natural language image description plus a cropping tool.

    3. Real-World Engineering Constraints of Agent Frameworks

    Delivering multimodal capabilities requires an agent harness to handle tool registration, context management, permissions, and logging. Common pain points in practice include:

    • Opaque configuration: Parameters such as model identifiers, backend addresses, timeouts, and retries are scattered across configuration files, environment variables, and command-line arguments. Documentation and implementation are inconsistent, leading to “configuration that does not work as documented.”
    • Version drift: Frameworks iterate quickly, and older versions do not support new model identifiers. Missing upgrade guidance leads users to mistakenly blame the model.
    • Role mismatch: The framework is designed for developers but is used as a product entry point for end users, with both interaction and documentation lacking proper guidance.

    The corresponding engineering recommendations are: consolidate configuration into a single source of truth, use a configuration structure with validation, and print an effective configuration summary at startup; establish an explicit registry for model capability declarations, including fields such as whether structured visual objects are supported, maximum input edge length, and maximum number of regions returnable per turn; and document upgrade paths in release notes to avoid implicit dependencies.

    An illustrative configuration structure (expressing organization only, not a specific product interface):

    1. {
    2. "model": "vision-capable-model",
    3. "profile": "web",
    4. "limits": { "max_image_edge": 1536, "max_regions_per_turn": 16 },
    5. "capabilities": ["structured_visual_reference", "tool_calling"],
    6. "logging": { "level": "info", "trace_tool_io": true }
    7. }

    4. Evaluation Methodology: Verifying Reference Reliability

    Do not let overall accuracy mask local defects. A layered evaluation is recommended:

    1. Perception layer: Given high-resolution original images, measure recall for small and dense objects, and observe performance curves under different scaling strategies.
    2. Reference layer: Require the model to output structured regions, compute intersection-over-union and center-point offset, and measure the ambiguity rate (the proportion of cases where the same target is pointed to different regions across turns).
    3. Planning layer: On tasks requiring multi-step decisions such as maze navigation and path planning, measure step success rate and number of rollbacks.
    4. Tool loop layer: Measure the validity rate of tool call parameters, the proportion of invalid crops, and the repeated call rate.

    A key lesson is that performance on public benchmarks may differ significantly from performance in a real agent pipeline. The reason is that benchmarks are typically single-turn, static evaluations without tool feedback, whereas agent scenarios involve multiple iterations and secondary image inputs returned by tools, which amplify errors. Therefore, evaluation must include “multi-turn tasks with tool feedback,” and random seeds and image preprocessing parameters must be fixed to ensure reproducibility.

    5. Common Failures and a Troubleshooting Checklist

    • Counting deviation: Suspect the tiling and scaling strategy first, and check whether structured reference is used. Compare different edge-length settings on the same image.
    • Localization drift: Check whether the coordinate normalization baseline is the full image or a tile. Mixing the two causes systematic offset.
    • Planning failure: Confirm whether the image returned by the tool carries positional information. Without positional anchors, the model cannot align the new fragment with the original image.
    • Configuration not taking effect: Verify the configuration loading order and priority, and print the final effective values. Confirm whether the version supports the target capability declaration.
    • Unparseable output: Add schema validation and automatic retry for structured output, and treat the parse failure rate as a top-level monitoring metric.

    6. Practical Recommendations and Selection Guidance

    If the task centers on dense counting, fine-grained localization, or industrial quality inspection, prioritize approaches that support structured visual objects and build a custom geometric-annotation evaluation set. If the task centers on visual question answering, document understanding, or UI operation assistance, the think-with-images approach combined with a cropping tool usually offers better cost-effectiveness, but the prompt and tool descriptions must enforce “locate first, then answer.”

    Regardless of the approach chosen, three things should be built as infrastructure: a unified image preprocessing and tiling service, a reusable region reference protocol, and regression evaluation covering both the perception and reference layers. If cloud resources are used, object storage can hold original and tiled images, a message queue can decouple image preprocessing from inference, a container platform can host tool services, and logging and monitoring with alerting can track parse failure rates and latency. This moves multimodal capabilities from “works in a demo” to “operationally maintainable.”