Skip to content

tools for agents - #215

Open
mawinter69 wants to merge 3 commits into
jenkinsci:mainfrom
mawinter69:agent-extension
Open

tools for agents#215
mawinter69 wants to merge 3 commits into
jenkinsci:mainfrom
mawinter69:agent-extension

Conversation

@mawinter69

Copy link
Copy Markdown
Contributor

Add 4 new tools to work with agents

  • listAgentNames: returns a list of all agents (doesn't include the built-in)
  • getAgent: Returns the Computer for the given agent (i.e. what also the api returns)
  • takeAgentOffline: take an agent offline with the given reason
  • takeAgentOnline: turn online

Testing done

full coverage with unit tests

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

Add 4 new tools to work with agents
- listAgentNames: returns a list of all agents (doesn't include the
  built-in)
- getAgent: Returns the Computer for the given agent (i.e. what also the
  api returns)
- takeAgentOffline: take an agent offline with the given reason
- takeAgentOnline: turn online
@mawinter69
mawinter69 requested a review from a team as a code owner August 3, 2026 17:05
@mawinter69

Copy link
Copy Markdown
Contributor Author

The getAgent returns the Computer object. So this is what you get when you access /computer//api/json. That might be a lot of data, when an agent has many executors and many labels. Though as an ExportedBean it supports to restrict the data with the tree argument

@olamy

olamy commented Aug 5, 2026

Copy link
Copy Markdown
Member

Instead of having both takeAgentOffline and takeAgentOnline, could we have a single mcp tool, such as agentStatus, with a parameter status (ONLINE or OFFLINE).
Bear in mind MCP servers are not API endpoints, it's a recommendation to avoid having too many tools to not blow up context

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.

2 participants