Skip to content

add get automation tag tool - #3562

Open
notapopsicle wants to merge 3 commits into
notapopsicle/list-automation-tagsfrom
notapopsicle/get-automation-tag
Open

notapopsicle wants to merge 3 commits into
notapopsicle/list-automation-tagsfrom
notapopsicle/get-automation-tag

Conversation

@notapopsicle

@notapopsicle notapopsicle commented Oct 23, 2026 •

Copy link
Copy Markdown

Summary

Add get_automation_tag to retrieve one caller-visible automation tag by ID through public REST.

Why

Agents need to inspect a tag they've selected from a repository's catalog. The tool is read-only and stays in the opt-in copilot_automations toolset. Live REST availability and permission behavior still need integration testing.

What changed

  • Register the get tool with its schema, docs and production-path tests.
  • Escape path segments, reject exact-dot paths before HTTP and preserve REST errors.

MCP impact

  • New tool added: get_automation_tag, available in read-only mode.

Prompts tested (tool changes only)

No natural-language prompts or live API calls were tested. Automated tests exercise MCP discovery and CallTool with mocked REST responses in both supported protocol modes.

Security / limits

  • Auth / permissions considered: uses the existing authenticated client and repo scope filter.
  • Data exposure, filtering, or token/size limits considered: returns known public fields, sanitizes tag names and descriptions and preserves missing or inaccessible resource errors.

Tool renaming

  • I am not renaming tools as part of this PR. Existing tool names are unchanged.

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Passed env -u UPDATE_TOOLSNAPS go test ./pkg/github -run '^Test_GetAutomationTag$' -count=1 -json (package: 0.899s). The named test ran, including snapshot, discovery, HTTP, response filtering and exact-dot regression assertions. Full lint and the full suite were left for CI.

Docs

  • Updated (README / docs / examples): generated tool and parameter documentation is included.

Related

Depends on github/github-mcp-server#3561 for the automation tag model and toolset.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Direct/library handler calls bypass schema validation, allowing missing identifiers to reach HTTP and an empty tag ID to target the collection route.

1 open issue
What changed in this PR

Adds get_automation_tag to inspect a tag selected from the repository catalog, complementing list_automation_tags in the opt-in copilot_automations toolset.

Changes:

  • Registers a read-only tag lookup with the repo scope requirement.
  • Escapes path segments, rejects exact-dot inputs, filters returned fields, and preserves REST errors.
  • Adds discovery and mocked API tests across both protocol modes, plus documentation and a schema snapshot.
File Description
README.md Documents the new tool, parameters, and required scope.
pkg/​github/​tools.go Registers GetAutomationTag in the tool inventory.
pkg/​github/​automation_tags.go Implements the schema, validation, and REST lookup.
pkg/​github/​automation_tags_test.go Adds lookup coverage and adjusts list-tool discovery assertions.
pkg/​github/​__toolsnaps__/​get_automation_tag.snap Records the new tool’s schema and metadata.

Review effort: Max

Comment thread pkg/github/automation_tags.go
@notapopsicle
notapopsicle added this pull request to stack #3570 October 23, 2026 19:44
Comment thread pkg/github/automation_tags.go
@notapopsicle
notapopsicle removed this pull request from stack #3570 October 23, 2026 20:04
Calls through ServerTool.Handler skip input schema validation, so check
owner, repo and tag_id before sending the request.
Apply the same filters as list results, since the tag comes back from
the same user-authored data.
@notapopsicle
notapopsicle force-pushed the notapopsicle/get-automation-tag branch from 50ac966 to 4a60242 Compare October 23, 2026 20:52
Comment thread pkg/github/automation_tags.go
Comment thread pkg/github/tools.go
@notapopsicle
notapopsicle added this pull request to stack #3571 October 23, 2026 21:26
@notapopsicle
notapopsicle marked this pull request as ready for review October 23, 2026 23:03
@notapopsicle
notapopsicle requested a review from a team as a code owner October 23, 2026 23:03
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.

4 participants