muxed 0.1.1 → 0.2.0

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.
package/README.md CHANGED
@@ -103,6 +103,8 @@ The format is intentionally compatible with the `mcpServers` section of `claude_
103
103
  | `muxed tools [server]` | List available tools (with annotations) |
104
104
  | `muxed info <server/tool>` | Tool schema details (inputSchema, outputSchema) |
105
105
  | `muxed call <server/tool> [json]` | Invoke a tool |
106
+ | `muxed call ... --dry-run` | Validate arguments without executing |
107
+ | `muxed call ... --fields <paths>` | Extract specific fields from the response |
106
108
  | `muxed grep <pattern>` | Search tool names, titles, and descriptions |
107
109
  | `muxed resources [server]` | List resources |
108
110
  | `muxed read <server/resource>` | Read a resource |
@@ -117,6 +119,49 @@ The format is intentionally compatible with the `mcpServers` section of `claude_
117
119
 
118
120
  All commands support `--json` for machine-readable output.
119
121
 
122
+ ## Agent-Friendly Features
123
+
124
+ ### Structured Errors with Recovery Suggestions
125
+
126
+ When a tool call fails, muxed returns structured error data with actionable suggestions and fuzzy-matched similar tool names — so agents can self-correct instead of guessing.
127
+
128
+ ```bash
129
+ muxed call slack/search_msgs '{}' --json
130
+ # {
131
+ # "code": -32602,
132
+ # "message": "Tool not found: slack/search_msgs",
133
+ # "data": {
134
+ # "code": "TOOL_NOT_FOUND",
135
+ # "suggestion": "Did you mean: slack/search_messages, slack/search_files? Run 'muxed grep <pattern>' to search available tools.",
136
+ # "context": { "similarTools": ["slack/search_messages", "slack/search_files"] }
137
+ # }
138
+ # }
139
+ ```
140
+
141
+ Error codes include `TOOL_NOT_FOUND`, `SERVER_NOT_FOUND`, `SERVER_NOT_CONNECTED`, `INVALID_FORMAT`, `MISSING_PARAMETER`, `INVALID_ARGUMENTS`, and `TIMEOUT`.
142
+
143
+ ### Dry-Run Validation
144
+
145
+ Validate arguments against a tool's schema without executing the call. Catches mistakes before wasting tokens on failed calls.
146
+
147
+ ```bash
148
+ muxed call postgres/query '{"sql": "DROP TABLE users"}' --dry-run
149
+ # Validation: passed
150
+ # Warnings:
151
+ # - Tool is marked as destructive.
152
+ # - Tool is not marked as idempotent.
153
+ ```
154
+
155
+ ### Response Field Filtering
156
+
157
+ Extract only the fields you need from tool responses. Reduces context window consumption when responses are large. Only applies to JSON-parseable outputs — non-JSON text is returned unchanged.
158
+
159
+ ```bash
160
+ muxed call postgres/query '{"sql": "SELECT * FROM users"}' --fields "rows[].name,rows[].email"
161
+ ```
162
+
163
+ Supports dot-notation paths (`data.user.name`) and array extraction (`rows[].field`). Works on `structuredContent` and JSON embedded in text content blocks.
164
+
120
165
  ## Node.js API
121
166
 
122
167
  muxed is also an npm package. Agents can write Node.js scripts that call MCP tools programmatically – with typed results, async/await, and the full npm ecosystem.
@@ -134,6 +179,15 @@ const result = await client.call('filesystem/read_file', {
134
179
  path: '/tmp/config.json',
135
180
  });
136
181
 
182
+ // Validate before calling (dry-run)
183
+ const check = await client.validate('postgres/query', { sql: 'DROP TABLE users' });
184
+ // check.valid, check.errors, check.warnings
185
+
186
+ // Call with field filtering
187
+ const filtered = await client.call('postgres/query', { sql: 'SELECT * FROM users' }, {
188
+ fields: ['rows[].name', 'rows[].email'],
189
+ });
190
+
137
191
  // Parallel calls across servers
138
192
  const [users, tickets] = await Promise.all([
139
193
  client.call('posthog/query-run', { query: { kind: 'HogQLQuery', query: 'SELECT ...' } }),
@@ -225,9 +279,12 @@ If you're using `mcp-remote` to connect Claude Desktop or ChatGPT to remote MCP
225
279
  | CLI interface | ✅ | ❌ | ❌ | ❌ | ✅ |
226
280
  | Auto-reconnect / health checks | ✅ | ❌ | ❌ | ✅ | ✅ |
227
281
  | MCP 2025-11-25 | ✅ | Partial | Partial | Partial | Partial |
228
- | Task support | ✅ | ❌ | ❌ | ❌ |
229
- | Zero config start | ✅ | ❌ | ❌ | ❌ |
230
- | Config compatible with Claude Desktop | ✅ | ❌ | | ❌ |
282
+ | Task support | ✅ | ❌ | ❌ | ❌ | |
283
+ | Dry-run validation | ✅ | ❌ | ❌ | ❌ | ❌ |
284
+ | Structured errors with suggestions | ✅ | ❌ | | ❌ | ❌ |
285
+ | Response field filtering | ✅ | ❌ | ❌ | ❌ | ❌ |
286
+ | Zero config start | ✅ | ❌ | ❌ | ❌ | |
287
+ | Config compatible with Claude Desktop | ✅ | ❌ | ✅ | ❌ | |
231
288
 
232
289
  ## Development
233
290