Skip to content

Commit d49f6d2

Browse files
authored
improve dhi and tools titles (#59)
1 parent bd76200 commit d49f6d2

File tree

7 files changed

+37
-24
lines changed

7 files changed

+37
-24
lines changed

src/accounts.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export class Accounts extends Asset {
7676
annotations: {
7777
title: 'List Namespaces',
7878
},
79+
title: 'List organisations (namespaces) the user has access to',
7980
},
8081
this.listNamespaces.bind(this)
8182
)
@@ -89,6 +90,7 @@ export class Accounts extends Asset {
8990
annotations: {
9091
title: 'Get Personal Namespace',
9192
},
93+
title: 'Get user personal namespace',
9294
},
9395
this.getPersonalNamespace.bind(this)
9496
)
@@ -102,6 +104,7 @@ export class Accounts extends Asset {
102104
annotations: {
103105
title: 'List All Namespaces user is a member of',
104106
},
107+
title: 'List all organisations (namespaces) the user is a member of including personal namespace',
105108
},
106109
() => {
107110
return {

src/repos.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ export class Repos extends Asset {
279279
annotations: {
280280
title: 'List Repositories by Namespace',
281281
},
282+
title: 'List Repositories by Organisation (namespace)',
282283
},
283284
this.listRepositoriesByNamespace.bind(this)
284285
)
@@ -296,6 +297,7 @@ export class Repos extends Asset {
296297
annotations: {
297298
title: 'Create Repository in namespace',
298299
},
300+
title: 'Create a repository in organisation (namespace) or personal namespace',
299301
},
300302
this.createRepository.bind(this)
301303
)
@@ -319,6 +321,7 @@ export class Repos extends Asset {
319321
annotations: {
320322
title: 'Get Repository Info',
321323
},
324+
title: 'Get Repository Details',
322325
},
323326
this.getRepositoryInfo.bind(this)
324327
)
@@ -362,6 +365,7 @@ export class Repos extends Asset {
362365
annotations: {
363366
title: 'Get Repository Info',
364367
},
368+
title: 'Update Repository Details',
365369
},
366370
this.updateRepositoryInfo.bind(this)
367371
)
@@ -378,6 +382,7 @@ export class Repos extends Asset {
378382
annotations: {
379383
title: 'Check Repository Exists',
380384
},
385+
title: 'Check Repository Exists',
381386
},
382387
this.checkRepository.bind(this)
383388
)
@@ -420,6 +425,7 @@ export class Repos extends Asset {
420425
annotations: {
421426
title: 'List Repository Tags',
422427
},
428+
title: 'List tags by repository',
423429
},
424430
this.listRepositoryTags.bind(this)
425431
)
@@ -442,6 +448,7 @@ export class Repos extends Asset {
442448
annotations: {
443449
title: 'Get Repository Tag',
444450
},
451+
title: 'Get Repository Tag Details',
445452
},
446453
this.getRepositoryTag.bind(this)
447454
)
@@ -461,6 +468,7 @@ export class Repos extends Asset {
461468
annotations: {
462469
title: 'Check Repository Tag',
463470
},
471+
title: 'Check Repository Tag Exists',
464472
},
465473
this.checkRepositoryTag.bind(this)
466474
)

src/scout.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,23 @@ export class ScoutAPI extends Asset {
5757
}
5858
RegisterTools(): void {
5959
this.tools.set(
60-
'docker-hardened-images',
60+
'dockerHardenedImages',
6161
this.server.registerTool(
62-
'docker-hardened-images',
62+
'dockerHardenedImages',
6363
{
6464
description:
65-
'This API is used to list Docker Hardened Images (DHIs) mirrored into one of the organisations of the user from the dhi organisation. Must be always prompted to input the organisation by the user. Docker Hardened Images are the most secure, minimal, production-ready images available, with near-zero CVEs and enterprise-grade SLA. Should be used to search for secure images in an organisation.',
65+
'This API is used to list Docker Hardened Images (DHIs) available in the user organisations. The tool takes the organisation name as input and returns the list of DHI images available in the organisation. It depends on the "listNamespaces" tool to be called first to get the list of organisations the user has access to.',
6666
inputSchema: z.object({
6767
organisation: z
6868
.string()
6969
.describe(
70-
'The organisation for which the DHIs are listed for. Must be always prompted to input the organisation by the user.'
70+
'The organisation for which the DHIs are listed for. If user does not explicitly ask for a specific organisation, the "listNamespaces" tool should be called first to get the list of organisations the user has access to.'
7171
),
7272
}).shape,
7373
annotations: {
7474
title: 'List available Docker Hardened Images',
7575
},
76+
title: 'List available Docker Hardened Images in user organisations',
7677
},
7778
this.dhis.bind(this)
7879
)

src/scripts/toolsList.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function getToolDefinitionList(): { tools: Tool[] } {
7070
tools.forEach((tool, name) => {
7171
const toolDefinition: Tool = {
7272
name,
73-
description: tool.description,
73+
description: tool.title, // Use title instead of description to have less noise in the tools list
7474
inputSchema: tool.inputSchema
7575
? (zodToJsonSchema(tool.inputSchema, {
7676
strictUnions: true,

src/search.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export class Search extends Asset {
9595
'search',
9696
{
9797
description:
98-
'Search for repositories. It sorts results by best match if no sort criteria is provided.',
98+
'Search for repositories in Docker Hub. It sorts results by best match if no sort criteria is provided. If user asks for secure, production-ready images the "dockerHardenedImages" tool should be called first to get the list of DHI images available in the user organisations (if any) and fallback to search tool if no DHI images are available or user is not authenticated.',
9999
inputSchema: {
100100
query: z.string().describe('The query to search for'),
101101
badges: z
@@ -148,8 +148,9 @@ export class Search extends Asset {
148148
},
149149
outputSchema: searchResults.shape,
150150
annotations: {
151-
title: 'List Repositories by Namespace',
151+
title: 'Search Repositories',
152152
},
153+
title: 'Search Repositories',
153154
},
154155
this.search.bind(this)
155156
)

tools.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"tools": [
33
{
44
"name": "listRepositoriesByNamespace",
5-
"description": "List paginated repositories by namespace",
5+
"description": "List Repositories by Organisation (namespace)",
66
"inputSchema": {
77
"type": "object",
88
"properties": {
@@ -618,7 +618,7 @@
618618
},
619619
{
620620
"name": "createRepository",
621-
"description": "Create a new repository in the given namespace. You MUST ask the user for the repository name and if the repository has to be public or private. Can optionally pass a description.\nIMPORTANT: Before calling this tool, you must ensure you have:\n - The repository name (name).",
621+
"description": "Create a repository in organisation (namespace) or personal namespace",
622622
"inputSchema": {
623623
"type": "object",
624624
"properties": {
@@ -1150,7 +1150,7 @@
11501150
},
11511151
{
11521152
"name": "getRepositoryInfo",
1153-
"description": "Get the details of a repository in the given namespace.",
1153+
"description": "Get Repository Details",
11541154
"inputSchema": {
11551155
"type": "object",
11561156
"properties": {
@@ -1664,7 +1664,7 @@
16641664
},
16651665
{
16661666
"name": "updateRepositoryInfo",
1667-
"description": "Update the details of a repository in the given namespace. Description, overview and status are the only fields that can be updated. While description and overview changes are fine, a status change is a dangerous operation so the user must explicitly ask for it.",
1667+
"description": "Update Repository Details",
16681668
"inputSchema": {
16691669
"type": "object",
16701670
"properties": {
@@ -2206,7 +2206,7 @@
22062206
},
22072207
{
22082208
"name": "checkRepository",
2209-
"description": "Check if a repository exists in the given namespace.",
2209+
"description": "Check Repository Exists",
22102210
"inputSchema": {
22112211
"type": "object",
22122212
"properties": {
@@ -2227,7 +2227,7 @@
22272227
},
22282228
{
22292229
"name": "listRepositoryTags",
2230-
"description": "List paginated tags by repository",
2230+
"description": "List tags by repository",
22312231
"inputSchema": {
22322232
"type": "object",
22332233
"properties": {
@@ -2775,7 +2775,7 @@
27752775
},
27762776
{
27772777
"name": "getRepositoryTag",
2778-
"description": "Get the details of a tag in a repository. It can be use to show the latest tag details for example.",
2778+
"description": "Get Repository Tag Details",
27792779
"inputSchema": {
27802780
"type": "object",
27812781
"properties": {
@@ -3224,7 +3224,7 @@
32243224
},
32253225
{
32263226
"name": "checkRepositoryTag",
3227-
"description": "Check if a tag exists in a repository",
3227+
"description": "Check Repository Tag Exists",
32283228
"inputSchema": {
32293229
"type": "object",
32303230
"properties": {
@@ -3248,7 +3248,7 @@
32483248
},
32493249
{
32503250
"name": "listNamespaces",
3251-
"description": "List paginated namespaces",
3251+
"description": "List organisations (namespaces) the user has access to",
32523252
"inputSchema": {
32533253
"type": "object",
32543254
"properties": {
@@ -3435,7 +3435,7 @@
34353435
},
34363436
{
34373437
"name": "getPersonalNamespace",
3438-
"description": "Get the personal namespace name",
3438+
"description": "Get user personal namespace",
34393439
"inputSchema": {
34403440
"type": "object"
34413441
},
@@ -3445,7 +3445,7 @@
34453445
},
34463446
{
34473447
"name": "listAllNamespacesMemberOf",
3448-
"description": "List all namespaces the user is a member of",
3448+
"description": "List all organisations (namespaces) the user is a member of including personal namespace",
34493449
"inputSchema": {
34503450
"type": "object"
34513451
},
@@ -3455,7 +3455,7 @@
34553455
},
34563456
{
34573457
"name": "search",
3458-
"description": "Search for repositories. It sorts results by best match if no sort criteria is provided.",
3458+
"description": "Search Repositories",
34593459
"inputSchema": {
34603460
"type": "object",
34613461
"properties": {
@@ -3559,7 +3559,7 @@
35593559
"$schema": "http://json-schema.org/draft-07/schema#"
35603560
},
35613561
"annotations": {
3562-
"title": "List Repositories by Namespace"
3562+
"title": "Search Repositories"
35633563
},
35643564
"outputSchema": {
35653565
"type": "object",
@@ -3778,14 +3778,14 @@
37783778
}
37793779
},
37803780
{
3781-
"name": "docker-hardened-images",
3782-
"description": "This API is used to list Docker Hardened Images (DHIs) mirrored into one of the organisations of the user from the dhi organisation. Must be always prompted to input the organisation by the user. Docker Hardened Images are the most secure, minimal, production-ready images available, with near-zero CVEs and enterprise-grade SLA. Should be used to search for secure images in an organisation.",
3781+
"name": "dockerHardenedImages",
3782+
"description": "List available Docker Hardened Images in user organisations",
37833783
"inputSchema": {
37843784
"type": "object",
37853785
"properties": {
37863786
"organisation": {
37873787
"type": "string",
3788-
"description": "The organisation for which the DHIs are listed for. Must be always prompted to input the organisation by the user."
3788+
"description": "The organisation for which the DHIs are listed for. If user does not explicitly ask for a specific organisation, the \"listNamespaces\" tool should be called first to get the list of organisations the user has access to."
37893789
}
37903790
},
37913791
"required": ["organisation"],

tools.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
- name: getPersonalNamespace
1111
- name: listAllNamespacesMemberOf
1212
- name: search
13-
- name: docker-hardened-images
13+
- name: dockerHardenedImages

0 commit comments

Comments
 (0)