Create Toolkits for GitHub Issues
You can connect GitHub with StackSpot AI using Toolkits. Follow these step-by-step instructions for the manual integration:
Step 1. Access the StackSpot AI Portal;
Step 2. Navigate to the 'Toolkits' section;
Step 3. Click the 'Create Toolkit' button and provide the following information:
- Name: Toolkit GitHub Issues
- Description: Toolkit to integrate with GitHub APIs for issue-related usage.
Add GitHub Tools
You must register a secret for GitHub API requests to authenticate with the API.
Create an issue
Click the 'Add Tool' button, then select the 'Manually' button and provide the following information:
- Name: Create an issue
- Method: Select 'POST'
- Tool Description: Creates a new issue in the specified repository.
- Invoke URL:
https://api.github.com/repos/{owner}/{repo}/issues. - Parameters:
Parameters list for this request[
{
"description": "The name of the repository owner (user or organization).",
"required": true,
"deprecated": false,
"explode": false,
"param_schema": {
"type": "string",
"example": "octocat"
},
"name": "owner",
"param_in": "path",
"allowEmptyValue": false,
"allowReserved": false
},
{
"description": "Repository name.",
"required": true,
"deprecated": false,
"explode": false,
"param_schema": {
"type": "string",
"example": "Hello-World"
},
"name": "repo",
"param_in": "path",
"allowEmptyValue": false,
"allowReserved": false
}
]
- Request Body:
Request Body for this example{
"description": "The request body containing the details of the issue to be created.",
"content": {
"application/json": {
"media_type_schema": {
"properties": {
"title": {
"type": "string",
"description": "The title of the issue.",
"example": "Bug: Login button does not work on mobile"
},
"body": {
"type": "string",
"description": "The detailed body of the issue. Supports Markdown formatting.",
"example": "The login button does not respond to touch on devices with a resolution lower than 480px."
},
"labels": {
"items": {
"type": "string"
},
"type": "array",
"description": "A list of label names to be applied to the issue.",
"example": [
"bug",
"mobile",
"urgent"
]
},
"assignees": {
"items": {
"type": "string"
},
"type": "array",
"description": "A list of user logins to be assigned to the issue.",
"example": [
"fulano-dev"
]
},
"milestone": {
"type": "integer",
"description": "The milestone ID number to be associated.",
"example": 1
}
},
"type": "object",
"required": [
"title"
]
}
}
},
"required": true
}
- Response Transformation:(Optional)
Jinja to return only the number and the issue link created{% if response.status_code == 201 %}
{
"issue_number": {{ response.json.number }},
"url": "{{ response.json.html_url }}"
}
{% else %}
{
"error": "{{ response.raw_data }}"
}
{% endif %}
Get an issue
Click the 'Add Tool' button, then select the 'Manually' button and provide the following information:
- Name: Get an issue
- Method: Select 'GET'
- Tool Description: Gets the details of a single issue by its number.
- Invoke URL:
https://api.github.com/repos/{owner}/{repo}/issues/{issue_number}. - Parameters:
Parameters list for this request[
{
"description": "The repository owner.",
"required": true,
"deprecated": false,
"explode": false,
"param_schema": {
"type": "string"
},
"name": "owner",
"param_in": "path",
"allowEmptyValue": false,
"allowReserved": false
},
{
"description": "The repository name.",
"required": true,
"deprecated": false,
"explode": false,
"param_schema": {
"type": "string"
},
"name": "repo",
"param_in": "path",
"allowEmptyValue": false,
"allowReserved": false
},
{
"description": "The issue number.",
"required": true,
"deprecated": false,
"explode": false,
"param_schema": {
"type": "integer"
},
"name": "issue_number",
"param_in": "path",
"allowEmptyValue": false,
"allowReserved": false
}
]
List issues from a repository
Click the 'Add Tool' button, then select the 'Manually' button and provide the following information:
- Name: List all repo issues
- Method: Select 'GET'
- Tool Description: This tool gets a list of all issues in a specific repository and allows filtering by status, tags, assignee, etc.
- Invoke URL:
https://api.github.com/repos/{owner}/{repo}/issues. - Parameters:
Parameters list for this request[
{
"description":"The repository owner.",
"required":true,
"deprecated":false,
"explode":false,
"param_schema":{
"type":"string"
},
"name":"owner",
"param_in":"path",
"allowEmptyValue":false,
"allowReserved":false
},
{
"description":"The repository name.",
"required":true,
"deprecated":false,
"explode":false,
"param_schema":{
"type":"string"
},
"name":"repo",
"param_in":"path",
"allowEmptyValue":false,
"allowReserved":false
},
{
"description":"Filter by issue state.",
"required":false,
"deprecated":false,
"explode":false,
"param_schema":{
"type":"string",
"enum":[
"open",
"closed",
"all"
],
"default":"open"
},
"name":"state",
"param_in":"query",
"allowEmptyValue":false,
"allowReserved":false
},
{
"description":"Comma-separated list of labels. E.g.: 'bug,docs'.",
"required":false,
"deprecated":false,
"explode":false,
"param_schema":{
"type":"string"
},
"name":"labels",
"param_in":"query",
"allowEmptyValue":false,
"allowReserved":false
},
{
"description":"Sorting criterion.",
"required":false,
"deprecated":false,
"explode":false,
"param_schema":{
"type":"string",
"enum":[
"created",
"updated",
"comments"
],
"default":"created"
},
"name":"sort",
"param_in":"query",
"allowEmptyValue":false,
"allowReserved":false
},
{
"description":"Sorting direction.",
"required":false,
"deprecated":false,
"explode":false,
"param_schema":{
"type":"string",
"enum":[
"asc",
"desc"
],
"default":"desc"
},
"name":"direction",
"param_in":"query",
"allowEmptyValue":false,
"allowReserved":false
},
{
"description":"Results per page.",
"required":false,
"deprecated":false,
"explode":false,
"param_schema":{
"type":"integer",
"default":30
},
"name":"per_page",
"param_in":"query",
"allowEmptyValue":false,
"allowReserved":false
}
]
Update an issue
Click the 'Add Tool' button, then select the 'Manually' button and provide the following information:
- Name: Update an issue
- Method: Select 'PATCH'
- Tool Description: Updates an existing issue's title, body, status, assignee, or other attributes.
- Invoke URL:
https://api.github.com/repos/{owner}/{repo}/issues/{issue_number}. - Parameters:
Parameters list for this request[
{
"description":"The repository owner.",
"required":true,
"deprecated":false,
"explode":false,
"param_schema":{
"type":"string"
},
"name":"owner",
"param_in":"path",
"allowEmptyValue":false,
"allowReserved":false
},
{
"description":"The repository name.",
"required":true,
"deprecated":false,
"explode":false,
"param_schema":{
"type":"string"
},
"name":"repo",
"param_in":"path",
"allowEmptyValue":false,
"allowReserved":false
},
{
"description":"The issue number.",
"required":true,
"deprecated":false,
"explode":false,
"param_schema":{
"type":"integer"
},
"name":"issue_number",
"param_in":"path",
"allowEmptyValue":false,
"allowReserved":false
}
]
- Request Body:
Request Body for this example{
"description":"Data to update an issue. All fields are optional.",
"content":{
"application/json":{
"media_type_schema":{
"properties":{
"title":{
"type":"string"
},
"body":{
"type":"string"
},
"state":{
"type":"string",
"enum":[
"open",
"closed"
]
},
"labels":{
"items":{
"type":"string"
},
"type":"array"
},
"assignees":{
"items":{
"type":"string"
},
"type":"array"
}
},
"type":"object"
}
}
},
"required":false
}
Lock an issue
Click the 'Add Tool' button, then select the 'Manually' button and provide the following information:
- Name: Lock an issue
- Method: Select 'PUT'
- Tool Description: Prevents new comments from being added to an issue.
- Invoke URL:
https://api.github.com/repos/{owner}/{repo}/issues/{issue_number}/lock. - Parameters:
Parameters list for this request[
{
"description":"The repository owner.",
"required":true,
"deprecated":false,
"explode":false,
"param_schema":{
"type":"string"
},
"name":"owner",
"param_in":"path",
"allowEmptyValue":false,
"allowReserved":false
},
{
"description":"The repository name.",
"required":true,
"deprecated":false,
"explode":false,
"param_schema":{
"type":"string"
},
"name":"repo",
"param_in":"path",
"allowEmptyValue":false,
"allowReserved":false
},
{
"description":"The issue number.",
"required":true,
"deprecated":false,
"explode":false,
"param_schema":{
"type":"integer"
},
"name":"issue_number",
"param_in":"path",
"allowEmptyValue":false,
"allowReserved":false
}
]
- Request Body:
Request Body for this example{
"content":{
"application/json":{
"media_type_schema":{
"properties":{
"lock_reason":{
"type":"string",
"enum":[
"off-topic",
"too heated",
"resolved",
"spam"
]
}
},
"type":"object"
}
}
},
"required":false
}
Unlock an issue
Click the 'Add Tool' button, then select the 'Manually' button and provide the following information:
- Name: Unlock an issue
- Method: Select 'DELETE'
- Tool Description: Allows new comments to be added to an issue.
- Invoke URL:
https://api.github.com/repos/{owner}/{repo}/issues/{issue_number}/lock. - Parameters:
Parameters list for this request[
{
"description":"The repository owner.",
"required":true,
"deprecated":false,
"explode":false,
"param_schema":{
"type":"string"
},
"name":"owner",
"param_in":"path",
"allowEmptyValue":false,
"allowReserved":false
},
{
"description":"The repository name.",
"required":true,
"deprecated":false,
"explode":false,
"param_schema":{
"type":"string"
},
"name":"repo",
"param_in":"path",
"allowEmptyValue":false,
"allowReserved":false
},
{
"description":"The issue number.",
"required":true,
"deprecated":false,
"explode":false,
"param_schema":{
"type":"integer"
},
"name":"issue_number",
"param_in":"path",
"allowEmptyValue":false,
"allowReserved":false
}
]
Test your Toolkit
Step 1. Create an Agent. Go to the 'Agents' section and click the Create Agent button. Provide the following details:
- Agent Name: GitHub Open Source Issues
- System Prompt:
“You're an agent who gets the full context of the conversation and opens an issue describing the problem and possible solutions. You always ask what issue-related action you want to perform: Create or Open an Issue, Get an Issue, List all issues in a repository, Update an Issue, Lock an Issue, Unlock an Issue.
You also ask for the repository where the issue should be opened and the repository owner.
You shouldn't open an issue without first obtaining this information.”
-
LLM: Add Azure GPT-4.1
-
Tools: Add all the Tools you previously created
- Unlock an Issue
- Allows new comments to be added to an issue.
-
Lock an Issue: Prevents new comments from being added to an issue.
-
Update an Issue: Updates an existing issue's title, body, status, assignee, or other attributes.
-
Get an Issue: Gets the details of a single issue by its number.
-
Create an Issue: Creates a new issue in the specified repository.
-
List Issues from a Repository: It gets a list of all issues in a specific repository and allows you to filter by status, tags, assignee, etc.
Step 2. Test your Agent with the Toolkits.