Problem/Motivation

The latest version of Tool has Tool Operations that are required.

Currently we hard code it, but it should be set per tool. So when you enable a version of a tool you need to pick this.

Proposed resolution

Add a setting per tool, where you can choose the tool operation for the tool you have enabled. Only local images are allowed.

Issue fork mcp_client-3559869

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

marcus_johansson created an issue. See original summary.

harivansh’s picture

StatusFileSize
new255.92 KB

@marcus_johansson
I think we should add another column in the tool maintenance section
Something like this
tools

We can have another property $tool_operations, in the confirm form, which stores the mapping b/w tool and operation
tool operation sc

harivansh’s picture

Issue summary: View changes
StatusFileSize
new86.9 KB
harivansh’s picture

Status: Active » Needs work
robertoperuzzo’s picture

That's a good idea!

In case we may use this simple method #3559613-4: Remove dependency on AI/AI Agents module to discover the operation's type dynamically, pre-populating the select box.

robertoperuzzo’s picture

Assigned: Unassigned » robertoperuzzo

robertoperuzzo’s picture

Assigned: robertoperuzzo » Unassigned
Status: Needs work » Needs review
harivansh’s picture

I think we should consolidate all tool configuration into a single tools property on the entity. This would eliminate the separate enabled_tools, locked_tools, and tool_operations arrays.

[
  'name' => 'tool_name',                    // Required: tool name
  'description' => 'Tool description',      // Required: tool description
  'input_schema' => [...],                  // Required: MCP tool schema

  // Configuration
  'enabled' => true,                        // Boolean: is tool enabled
  'locked' => false,                        // Boolean: is tool locked
  'operation' => 'read',                    // String: read|write
  
  // Locked definition (only if locked === true)
  'locked_definition' => [
    'name' => 'tool_name',
    'description' => 'Tool description',
    'input_schema' => [...],
  ],
]

To make this more maintainable and type-safe, we should also create dedicated DTOs/Value Objects for this:

ToolCollection - represents the collection of all tools
Tool - represents a single tool with all its configuration
InputSchema - represents the tool's input schema
LockDefinition - represents the locked tool definition
This approach would give us a single source of truth, cleaner code, and better type safety throughout the codebase.

What your though on this.

robertoperuzzo’s picture

That's awesome! I opened a new issue for the refactoring #3561170: Consolidate Tool Configuration Into a Single tools Property. Could you take a look at it? Maybe I missed something ...

I propose merging and closing this issue to keep the issue's context clean and separate from the refactoring.

robertoperuzzo’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.