Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jun 3, 2025

This PR adds two new environment variable configuration options to control shortcut tool generation behavior:

New Configuration Options

GENERATE_SHORTCUT_TOOLS (default: true)

Controls whether dynamic shortcut tools are generated for each available shortcut. When set to false, only the base tools (list_shortcuts, open_shortcut, run_shortcut) will be available.

INJECT_SHORTCUT_LIST (default: false)

When set to true, injects the list of available shortcuts with their identifiers into the run_shortcut tool description to help the LLM understand which shortcuts are available.

Usage Example

{
  "mcpServers": {
    "siri-shortcuts": {
      "command": "npx",
      "args": ["mcp-server-siri-shortcuts"],
      "env": {
        "GENERATE_SHORTCUT_TOOLS": "false",
        "INJECT_SHORTCUT_LIST": "true"
      }
    }
  }
}

Implementation Details

  • Environment variables are read at module import time
  • GENERATE_SHORTCUT_TOOLS defaults to true unless explicitly set to "false"
  • INJECT_SHORTCUT_LIST defaults to false unless explicitly set to "true"
  • The tool list generation conditionally includes dynamic tools based on GENERATE_SHORTCUT_TOOLS
  • The run_shortcut description conditionally includes the shortcut list based on INJECT_SHORTCUT_LIST
  • Call tool handler respects the GENERATE_SHORTCUT_TOOLS setting when validating dynamic tool calls

The changes are minimal and maintain backward compatibility - existing installations will continue to work with the same behavior (all dynamic tools generated, no shortcut list injection).

Fixes #7.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add config settings for generating shortcut tools Add config settings for generating shortcut tools Jun 3, 2025
Copilot AI requested a review from dvcrn June 3, 2025 13:16
Copilot finished work on behalf of dvcrn June 3, 2025 13:17
Copy link
Owner

@dvcrn dvcrn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase latest main, add tests

Copilot finished work on behalf of dvcrn June 3, 2025 23:31
@dvcrn
Copy link
Owner

dvcrn commented Jun 3, 2025

Rebased latest main branch which has test setup. Need to add tests

Copy link
Contributor Author

Copilot AI commented Jun 3, 2025

Rebased latest main branch which has test setup. Need to add tests

Added comprehensive tests for the new configuration options in commit 5a67bdd. The tests cover:

  • Environment variable parsing logic for both GENERATE_SHORTCUT_TOOLS and INJECT_SHORTCUT_LIST
  • Configuration integration scenarios including shortcut list injection
  • Tool validation behavior with different settings
  • Combined configuration scenarios
  • Edge cases and default behaviors

All tests are passing and the build is successful.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • http://168.63.129.16:80/machine/
    • Triggering command: /usr/bin/python3 -u bin/WALinuxAgent-2.13.1.1-py3.9.egg -collect-logs (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of dvcrn June 3, 2025 23:48
@dvcrn dvcrn marked this pull request as ready for review June 4, 2025 04:30
@dvcrn dvcrn merged commit b772b9f into main Jun 4, 2025
3 checks passed
@dvcrn dvcrn deleted the copilot/fix-7 branch June 4, 2025 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add config settings for generating shortcut tools

2 participants