You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
namespace: z.string().describe('The namespace of the repository. Required.'),
127
128
name: z
128
129
.string()
130
+
.default('')
129
131
.describe(
130
-
'The name of the repository. Must contain a combination of alphanumeric characters and may contain the special characters ., _, or -. Letters must be lowercase. Required.'
132
+
'The name of the repository (required). Must contain a combination of alphanumeric characters and may contain the special characters ., _, or -. Letters must be lowercase.'
131
133
),
132
134
description: z.string().optional().describe('The description of the repository'),
133
135
is_private: z.boolean().optional().describe('Whether the repository is private'),
@@ -288,7 +290,7 @@ export class Repos extends Asset {
288
290
'createRepository',
289
291
{
290
292
description:
291
-
'Create a new repository in the given namespace. User must pass the repository name and if the repository has to be public or private. Can optionally pass a description.',
293
+
'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).',
292
294
inputSchema: CreateRepositoryRequest.shape,
293
295
outputSchema: Repository.shape,
294
296
annotations: {
@@ -305,7 +307,14 @@ export class Repos extends Asset {
305
307
'getRepositoryInfo',
306
308
{
307
309
description: 'Get the details of a repository in the given namespace.',
'The namespace of the repository (required). If not provided the `library` namespace will be used for official images.'
315
+
),
316
+
repository: z.string().describe('The repository name (required)'),
317
+
}).shape,
309
318
outputSchema: Repository.shape,
310
319
annotations: {
311
320
title: 'Get Repository Info',
@@ -321,13 +330,33 @@ export class Repos extends Asset {
321
330
this.server.registerTool(
322
331
'updateRepositoryInfo',
323
332
{
324
-
description: 'Update the details of a repository in the given namespace.',
333
+
description:
334
+
'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.',
.describe('The namespace of the repository (required)'),
339
+
repository: z.string().describe('The repository name (required)'),
340
+
description: z
341
+
.string()
342
+
.optional()
343
+
.describe(
344
+
'The description of the repository. If user asks for updating the description of the repository, this is the field that should be updated.'
345
+
),
346
+
full_description: z
347
+
.string()
348
+
.max(25000)
349
+
.optional()
350
+
.describe(
351
+
'The full description (overview)of the repository. If user asks for updating the full description or the overview of the repository, this is the field that should be updated. '
352
+
),
353
+
status: z
354
+
.enum(['active','inactive'])
355
+
.optional()
356
+
.nullable()
357
+
.describe(
358
+
'The status of the repository. If user asks for updating the status of the repository, this is the field that should be updated. This is a dangerous operation and should be done with caution so user must be prompted to confirm the operation. Valid status are `active` (1) and `inactive` (0). Normally do not update the status if it is not strictly required by the user. It is not possible to change an `inactive` repository to `active` if it has no images.'
359
+
),
331
360
}).shape,
332
361
outputSchema: Repository.shape,
333
362
annotations: {
@@ -530,6 +559,7 @@ export class Repos extends Asset {
530
559
): Promise<CallToolResult>{
531
560
// sometimes the mcp client tries to pass a default repository name. Fail in this case.
`Here are the details of the repository :${repository} in ${namespace}. :response`,
560
592
`Error getting repository info for ${repository} in ${namespace}`
561
593
);
594
+
if(namespace==='library'){
595
+
response.content.push({
596
+
type: 'text',
597
+
text: `This is an official image from Docker Hub. You can access it at https://hub.docker.com/_/${repository}.\nIf you did not ask for an official image, please call this tool again and clearly specify a namespace.`,
598
+
});
599
+
}
600
+
returnresponse;
562
601
}
563
602
564
603
privateasyncupdateRepositoryInfo({
@@ -572,23 +611,76 @@ export class Repos extends Asset {
`Repository ${repository} in ${namespace} is currently in status ${currentStatus}. Updating to ${status}.`
652
+
);
653
+
if(status==='active'){
654
+
return{
655
+
isError: true,
656
+
content: [
657
+
{
658
+
type: 'text',
659
+
text: `Repository ${repository} in ${namespace} is currently inactive. It is not possible to change an inactive repository to active if it has no images. If you did not ask for updating the status of the repository, please call this tool again and specifically ask for updating only the description or the overview of the repository.`,
660
+
},
661
+
],
662
+
structuredContent: {
663
+
error: `Repository ${repository} in ${namespace} is currently inactive. It is not possible to change an inactive repository to active if it has no images. If you did not ask for updating the status of the repository, please call this tool again and specifically ask for updating only the description or the overview of the repository.`,
664
+
},
665
+
};
666
+
}
667
+
body.status=status==='active' ? 1 : 0;
668
+
extraContent.push({
669
+
type: 'text',
670
+
text: `Requested a status change from ${currentStatus} to ${status}. This is potentially a dangerous operation and should be done with caution. If you are not sure, please go on Docker Hub and revert the status manually.\nhttps://hub.docker.com/r/${namespace}/${repository}`,
Copy file name to clipboardExpand all lines: src/scout.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,7 @@ export class ScoutAPI extends Asset {
62
62
'docker-hardened-images',
63
63
{
64
64
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 image in an organisation.',
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.',
Copy file name to clipboardExpand all lines: tools.json
+35-12Lines changed: 35 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -618,7 +618,7 @@
618
618
},
619
619
{
620
620
"name": "createRepository",
621
-
"description": "Create a new repository in the given namespace. User must pass the repository name and if the repository has to be public or private. Can optionally pass a description.",
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).",
622
622
"inputSchema": {
623
623
"type": "object",
624
624
"properties": {
@@ -628,7 +628,8 @@
628
628
},
629
629
"name": {
630
630
"type": "string",
631
-
"description": "The name of the repository. Must contain a combination of alphanumeric characters and may contain the special characters ., _, or -. Letters must be lowercase. Required."
631
+
"default": "",
632
+
"description": "The name of the repository (required). Must contain a combination of alphanumeric characters and may contain the special characters ., _, or -. Letters must be lowercase."
632
633
},
633
634
"description": {
634
635
"type": "string",
@@ -648,7 +649,7 @@
648
649
"description": "The registry to create the repository in"
"description": "The namespace of the repository (required). If not provided the `library` namespace will be used for official images."
1158
1160
},
1159
1161
"repository": {
1160
-
"type": "string"
1162
+
"type": "string",
1163
+
"description": "The repository name (required)"
1161
1164
}
1162
1165
},
1163
1166
"required": ["namespace", "repository"],
@@ -1661,25 +1664,45 @@
1661
1664
},
1662
1665
{
1663
1666
"name": "updateRepositoryInfo",
1664
-
"description": "Update the details of a repository in the given namespace.",
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.",
1665
1668
"inputSchema": {
1666
1669
"type": "object",
1667
1670
"properties": {
1668
1671
"namespace": {
1669
-
"type": "string"
1672
+
"type": "string",
1673
+
"description": "The namespace of the repository (required)"
1670
1674
},
1671
1675
"repository": {
1672
-
"type": "string"
1676
+
"type": "string",
1677
+
"description": "The repository name (required)"
1673
1678
},
1674
1679
"description": {
1675
-
"type": "string"
1680
+
"type": "string",
1681
+
"description": "The description of the repository. If user asks for updating the description of the repository, this is the field that should be updated."
1676
1682
},
1677
1683
"full_description": {
1678
1684
"type": "string",
1679
-
"maxLength": 25000
1685
+
"maxLength": 25000,
1686
+
"description": "The full description (overview)of the repository. If user asks for updating the full description or the overview of the repository, this is the field that should be updated. "
1680
1687
},
1681
1688
"status": {
1682
-
"type": "number"
1689
+
"anyOf": [
1690
+
{
1691
+
"anyOf": [
1692
+
{
1693
+
"not": {}
1694
+
},
1695
+
{
1696
+
"type": "string",
1697
+
"enum": ["active", "inactive"]
1698
+
}
1699
+
]
1700
+
},
1701
+
{
1702
+
"type": "null"
1703
+
}
1704
+
],
1705
+
"description": "The status of the repository. If user asks for updating the status of the repository, this is the field that should be updated. This is a dangerous operation and should be done with caution so user must be prompted to confirm the operation. Valid status are `active` (1) and `inactive` (0). Normally do not update the status if it is not strictly required by the user. It is not possible to change an `inactive` repository to `active` if it has no images."
1683
1706
}
1684
1707
},
1685
1708
"required": ["namespace", "repository"],
@@ -3756,7 +3779,7 @@
3756
3779
},
3757
3780
{
3758
3781
"name": "docker-hardened-images",
3759
-
"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 image in an organisation.",
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.",
0 commit comments