MCPcopy
hub / github.com/xpf0000/FlyEnv / buildToolDefs

Method buildToolDefs

src/main/core/MCPServer.ts:111–592  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

109 }
110
111 private buildToolDefs() {
112 const queryableFlagEnum = { type: 'string', enum: [...MCP_QUERYABLE_FLAGS] }
113 const lifecycleFlagEnum = { type: 'string', enum: [...MCP_LIFECYCLE_FLAGS] }
114 const installableFlagEnum = { type: 'string', enum: [...MCP_INSTALLABLE_FLAGS] }
115 const databaseFlagEnum = {
116 type: 'string',
117 enum: [...MCP_DATABASE_FLAGS]
118 }
119
120 this.toolDefs = [
121 {
122 name: 'list_services',
123 description: MCP_TOOL_DESCRIPTIONS.listServices,
124 inputSchema: {
125 type: 'object',
126 properties: {
127 flags: {
128 type: 'array',
129 items: queryableFlagEnum,
130 description:
131 'Optional list of version-managed module flags to inspect. Omit or pass [] to return only currently cached version-managed modules.'
132 }
133 }
134 },
135 handler: async (args) => textResult(await this.tools.listServices(args?.flags))
136 },
137 {
138 name: 'service_status',
139 description: MCP_TOOL_DESCRIPTIONS.serviceStatus,
140 inputSchema: {
141 type: 'object',
142 properties: {
143 flag: {
144 ...queryableFlagEnum,
145 description: MCP_FLAG_DESCRIPTIONS.queryable
146 }
147 },
148 required: ['flag']
149 },
150 handler: async (args) => {
151 const flag = Array.isArray(args.flag) ? args.flag[0] : args.flag
152 return textResult(await this.tools.serviceStatus(flag))
153 }
154 },
155 {
156 name: 'list_sites',
157 description: MCP_TOOL_DESCRIPTIONS.listSites,
158 inputSchema: { type: 'object', properties: {} },
159 handler: async () => textResult(await this.tools.listSites())
160 },
161 {
162 name: 'get_database_connection_info',
163 description: MCP_TOOL_DESCRIPTIONS.getDatabaseConnectionInfo,
164 inputSchema: {
165 type: 'object',
166 properties: {
167 flag: {
168 ...databaseFlagEnum,

Callers 1

constructorMethod · 0.95

Calls 15

textResultFunction · 0.90
listServicesMethod · 0.80
serviceStatusMethod · 0.80
listSitesMethod · 0.80
listOnlineVersionsMethod · 0.80
stopAllServiceMethod · 0.80
restartServiceMethod · 0.80
createSiteMethod · 0.80
updateSiteMethod · 0.80
deleteSiteMethod · 0.80
installServiceMethod · 0.80

Tested by

no test coverage detected