Skip to content

Support agent-home-relative file references in MCP dial_url parameters #445

Description

@andrii-novikov

QuickApps version

latest

What is the problem this feature will solve?

MCP tool parameters marked dial_url: true reject agent-home-relative references (e.g. reports/img.png) — _MCPTool._collect_dial_url_files raises InvalidToolCallParameterException for UrlScheme.DIAL_APPDIR_RELATIVE just like for unsupported schemes (see TODO(#445) at the rejection branch).

Since #444 the internal_attachments_get_content tool resolves these references under the agent home via HomePathResolver, and the internal_file_* tools both speak and echo this convention. The model therefore reasonably tries the same reference form with MCP tools and gets rejected, forcing it to guess the absolute files/... form it has never seen.

What is the feature you are proposing to solve the problem?

Resolve appdir-relative references before granting file permissions, instead of rejecting them:

  • inject HomePathResolver (from shared/home_path) into _MCPTool
  • in _collect_dial_url_files, resolve UrlScheme.DIAL_APPDIR_RELATIVE values via resolve_appdata_url (this makes collection async — the call chain needs adjusting)
  • grant permissions on the resolved files/... URL and pass it to the MCP server

Detection must use the canonical predicate is_appdir_relative / classify_url from common/url_classification.py so the grammar stays consistent with get_content.

What alternatives have you considered?

  • Keep rejecting with a clearer message (current state after feat: resolve agent-home-relative file references in get_content #444): the rejection is explicit and consistent, but the model still cannot pass workspace files to MCP tools without discovering the absolute URL, which the file tools never display.
  • Resolve in the model prompt/tool description (instruct the model to expand references itself): the model does not know the files/{appdata}/{home} prefix, so it cannot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions