Skip to content

[FEATURE]: Display MCP Tool Parameters in Permission Dialog #12111

Closed

Description

@broboa

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Problem

When MCP tools are invoked (e.g., memory_create_entities, memory_add_observations), the permission dialog only displays the tool name without showing the actual parameters being passed. This makes it difficult to understand what the tool will do and whether to approve the action.

Current behavior:

Call tool memory_create_entities

Expected behavior:

Call tool memory_create_entities
entities: [
  {
    name: "OpenCode",
    entityType: "project",
    observations: ["Uses Bun monorepo structure"]
  }
]

Current Implementation

The permission prompt component (packages/opencode/src/cli/cmd/tui/routes/session/permission.tsx) has explicit display logic for built-in tools:

  • read - shows file path
  • glob - shows pattern
  • grep - shows pattern
  • bash - shows description and command
  • task - shows subagent type and description
  • webfetch - shows URL

MCP tools fall through to a generic fallback case (line 262-264):

<Match when={true}>
  <TextBody icon="⚙" title={`Call tool ` + props.request.permission} />
</Match>

The input() memo (lines 128-138) already contains the tool parameters but isn't rendered in this fallback case.

Proposed Solution

Configuration Options

Add configuration to control parameter visibility:

{
  "tui": {
    "mcp_show_parameters": "all" | "none" | "selected",
    "mcp_show_parameters_tools": ["memory_create_entities", "memory_add_observations"]
  }
}

Configuration modes:

  • all - Show parameters for all MCP tools (default for transparency)
  • none - Hide parameters for all MCP tools (minimal UI)
  • selected - Show parameters only for tools listed in mcp_show_parameters_tools

Implementation Approach

Modify the fallback case to conditionally display tool parameters based on config:

<Match when={true}>
  {(() => {
    const shouldShowParams = (() => {
      const mode = sync.data.config.tui?.mcp_show_parameters ?? "all"
      if (mode === "none") return false
      if (mode === "all") return true
      const allowedTools = sync.data.config.tui?.mcp_show_parameters_tools ?? []
      return allowedTools.includes(props.request.permission)
    })()
    
    const params = shouldShowParams && Object.keys(input()).length > 0
      ? JSON.stringify(input(), null, 2)
      : undefined
    
    return (
      <TextBody 
        icon="⚙" 
        title={`Call tool ` + props.request.permission}
        description={params}
      />
    )
  })()}
</Match>

Display Options

For parameter rendering:

  1. Formatted JSON view - Display parameters as indented JSON
  2. Key-value list - Show each parameter as a labeled field
  3. Smart truncation - Show first N characters with expand option for large payloads

Impact

  • Improves transparency when using MCP tools
  • Allows users to make informed permission decisions
  • Maintains consistency with how built-in tools display their parameters
  • Critical for security-sensitive operations like knowledge graph modifications

Additional Context

This affects all MCP server tools, not just memory operations. Any custom MCP tool will have this limitation.

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Feb 4, 2026
  2. broboa commented on Feb 4, 2026

    @broboa
    Author

    Related #6604

  3. github-actions commented on Apr 6, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

  4. broboa commented on Apr 7, 2026

    @broboa
    Author

    @thdxr can you reopen this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

discussionUsed for feature requests, proposals, ideas, etc. Open discussion

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions