@toolplex/client 0.1.16 → 0.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,11 +40,7 @@ export async function handleGetServerConfig(params) {
40
40
  content: [
41
41
  {
42
42
  type: "text",
43
- text: promptsCache
44
- .getPrompt("get_server_config_header")
45
- .replace("{SERVER_ID}", server_id) +
46
- "\n" +
47
- JSON.stringify(config, null, 2),
43
+ text: JSON.stringify(config, null, 2),
48
44
  },
49
45
  ],
50
46
  };
@@ -145,15 +145,7 @@ export async function handleInstallServer(params) {
145
145
  if (!parsed.success) {
146
146
  throw new Error(`Invalid list_tools response: ${JSON.stringify(parsed.error.errors)}, response was: ${JSON.stringify(toolsResponse)}`);
147
147
  }
148
- let toolsText = "";
149
148
  const tools = parsed.data.tools || [];
150
- if (tools.length > 0) {
151
- toolsText = "Available tools from this server:\n\n";
152
- for (const tool of tools) {
153
- toolsText += `- ${tool.name}: ${tool.description}\n`;
154
- toolsText += ` Input Schema: ${JSON.stringify(tool.inputSchema, null, 2)}\n\n`;
155
- }
156
- }
157
149
  await telemetryLogger.log("client_install", {
158
150
  success: true,
159
151
  log_context: {
@@ -162,24 +154,22 @@ export async function handleInstallServer(params) {
162
154
  },
163
155
  latency_ms: Date.now() - startTime,
164
156
  });
165
- const content = [
166
- {
167
- type: "text",
168
- text: promptsCache
169
- .getPrompt("install_success")
170
- .replace("{SERVER_ID}", installResult.server_id)
171
- .replace("{SERVER_NAME}", installResult.server_name)
172
- .replace("{TOOLS_LIST}", toolsText),
173
- },
174
- ];
175
- if (!clientContext.permissions.enable_read_only_mode) {
176
- content.push({
177
- type: "text",
178
- text: promptsCache.getPrompt("install_next_steps"),
179
- });
180
- }
157
+ // Return structured JSON for clean UI rendering
158
+ const response = {
159
+ success: true,
160
+ server_id: installResult.server_id,
161
+ server_name: installResult.server_name,
162
+ message: `Successfully installed server ${installResult.server_id} (${installResult.server_name})`,
163
+ tools: tools,
164
+ tool_count: tools.length,
165
+ };
181
166
  return {
182
- content,
167
+ content: [
168
+ {
169
+ type: "text",
170
+ text: JSON.stringify(response, null, 2),
171
+ },
172
+ ],
183
173
  };
184
174
  }
185
175
  catch (error) {
@@ -196,23 +186,20 @@ export async function handleInstallServer(params) {
196
186
  pii_sanitized_error_message: errorMessage,
197
187
  latency_ms: Date.now() - startTime,
198
188
  });
199
- const content = [
200
- {
201
- type: "text",
202
- text: promptsCache
203
- .getPrompt("install_failure")
204
- .replace("{ERROR}", errorMessage),
205
- },
206
- ];
207
- if (!clientContext.permissions.enable_read_only_mode) {
208
- content.push({
209
- type: "text",
210
- text: promptsCache.getPrompt("install_next_steps"),
211
- });
212
- }
189
+ // Return structured error JSON
190
+ const errorResponse = {
191
+ success: false,
192
+ error: errorMessage,
193
+ server_id: params.server_id,
194
+ };
213
195
  return {
214
196
  isError: true,
215
- content,
197
+ content: [
198
+ {
199
+ type: "text",
200
+ text: JSON.stringify(errorResponse, null, 2),
201
+ },
202
+ ],
216
203
  };
217
204
  }
218
205
  finally {
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "0.1.16";
1
+ export declare const version = "0.1.18";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '0.1.16';
1
+ export const version = '0.1.18';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toolplex/client",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "author": "ToolPlex LLC",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "description": "The official ToolPlex client for AI agent tool discovery and execution",