@@ -4,7 +4,11 @@ import packageJSON from '../../package.json' with { type: 'json' };
4
4
import { ArgoCDClient } from '../argocd/client.js' ;
5
5
import { z , ZodRawShape } from 'zod' ;
6
6
import { Application , ResourceRef } from '../shared/models/models.js' ;
7
- import { ApplicationSchema , ResourceRefSchema } from '../shared/models/schema.js' ;
7
+ import {
8
+ ApplicationNamespaceSchema ,
9
+ ApplicationSchema ,
10
+ ResourceRefSchema
11
+ } from '../shared/models/schema.js' ;
8
12
9
13
type ServerInfo = {
10
14
argocdBaseUrl : string ;
@@ -80,11 +84,7 @@ export class Server extends McpServer {
80
84
'get_application_workload_logs returns logs for application workload (Deployment, StatefulSet, Pod, etc.) by application name and resource ref' ,
81
85
{
82
86
applicationName : z . string ( ) ,
83
- applicationNamespace : z
84
- . string ( )
85
- . describe (
86
- 'Namespace of the application, note the namespace is not always the same as the resource namespace'
87
- ) ,
87
+ applicationNamespace : ApplicationNamespaceSchema ,
88
88
resourceRef : ResourceRefSchema
89
89
} ,
90
90
async ( { applicationName, applicationNamespace, resourceRef } ) =>
@@ -105,11 +105,7 @@ export class Server extends McpServer {
105
105
'get_resource_events returns events for a resource that is managed by an application' ,
106
106
{
107
107
applicationName : z . string ( ) ,
108
- applicationNamespace : z
109
- . string ( )
110
- . describe (
111
- 'Namespace of the application, note the namespace is not always the same as the resource namespace'
112
- ) ,
108
+ applicationNamespace : ApplicationNamespaceSchema ,
113
109
resourceUID : z . string ( ) ,
114
110
resourceNamespace : z . string ( ) ,
115
111
resourceName : z . string ( )
@@ -134,11 +130,7 @@ export class Server extends McpServer {
134
130
'get_resource_actions returns actions for a resource that is managed by an application' ,
135
131
{
136
132
applicationName : z . string ( ) ,
137
- applicationNamespace : z
138
- . string ( )
139
- . describe (
140
- 'Namespace of the application, note the namespace is not always the same as the resource namespace'
141
- ) ,
133
+ applicationNamespace : ApplicationNamespaceSchema ,
142
134
resourceRef : ResourceRefSchema
143
135
} ,
144
136
async ( { applicationName, applicationNamespace, resourceRef } ) =>
@@ -153,11 +145,7 @@ export class Server extends McpServer {
153
145
'run_resource_action runs an action on a resource' ,
154
146
{
155
147
applicationName : z . string ( ) ,
156
- applicationNamespace : z
157
- . string ( )
158
- . describe (
159
- 'Namespace of the application, note the namespace is not always the same as the resource namespace'
160
- ) ,
148
+ applicationNamespace : ApplicationNamespaceSchema ,
161
149
resourceRef : ResourceRefSchema ,
162
150
action : z . string ( )
163
151
} ,
0 commit comments