Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/zai-cli/src/commands/code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Options:

Examples:
zai-cli code run ./chain.ts
zai-cli code eval "const r = await zai.search.webSearchPrime({search_query:'ZAI'}); return r;"
zai-cli code eval "const r = await zai.search.web_search_prime({search_query:'ZAI'}); return r;"
zai-cli code interfaces
zai-cli code prompt
`.trim();
2 changes: 1 addition & 1 deletion packages/zai-cli/src/commands/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ Options:
--no-vision Skip vision MCP server (faster startup)

Examples:
zai-cli call zai.search.webSearchPrime --json '{"search_query":"LLM tools"}'
zai-cli call zai.search.web_search_prime --json '{"search_query":"LLM tools"}'
zai-cli call zai.reader.webReader --file ./args.json
echo '{"repo_name":"owner/repo"}' | zai-cli call zai.zread.get_repo_structure --stdin
`.trim();
2 changes: 1 addition & 1 deletion packages/zai-cli/src/lib/mcp-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ export class ZaiMcpClient {
args.location = params.location;
}

return this.callTool<WebSearchResult[]>(getMcpToolName('search', 'webSearchPrime'), args);
return this.callTool<WebSearchResult[]>(getMcpToolName('search', 'web_search_prime'), args);
}

// ============ Web Reader Methods ============
Expand Down
29 changes: 29 additions & 0 deletions packages/zai-cli/tests/mcp-client.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { test } from 'node:test';
import assert from 'node:assert/strict';

import { ZaiMcpClient } from '../dist/lib/mcp-client.js';

test('webSearch calls the discovered snake-case search tool', async () => {
const client = new ZaiMcpClient({ enableVision: false });
let called;
client.callTool = async (toolName, args) => {
called = { toolName, args };
return [];
};

const result = await client.webSearch({
query: 'hello world',
recencyFilter: 'oneWeek',
location: 'us',
});

assert.deepEqual(result, []);
assert.deepEqual(called, {
toolName: 'zai.search.web_search_prime',
args: {
search_query: 'hello world',
search_recency_filter: 'oneWeek',
location: 'us',
},
});
});
6 changes: 3 additions & 3 deletions packages/zai-cli/tests/mcp-live.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describeLive('MCP Live Tests', () => {

it('includes expected core tools', () => {
const expected = [
getMcpToolName('search', 'webSearchPrime'),
getMcpToolName('search', 'web_search_prime'),
getMcpToolName('reader', 'webReader'),
getMcpToolName('zread', 'search_doc'),
getMcpToolName('zread', 'get_repo_structure'),
Expand Down Expand Up @@ -115,8 +115,8 @@ describeLive('MCP Live Tests', () => {

const handlers = new Map();

handlers.set(getMcpToolName('search', 'webSearchPrime'), async () =>
client.callToolRaw(getMcpToolName('search', 'webSearchPrime'), {
handlers.set(getMcpToolName('search', 'web_search_prime'), async () =>
client.callToolRaw(getMcpToolName('search', 'web_search_prime'), {
search_query: 'hello world',
search_recency_filter: 'oneMonth',
content_size: 'medium',
Expand Down
4 changes: 2 additions & 2 deletions skills/zai-cli/references/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ Use these when you need schemas or direct tool invocation.
```bash
zai-cli tools --filter vision --full
zai-cli tool zai.zread.search_doc --no-vision
zai-cli call zai.search.webSearchPrime --json '{"search_query":"LLM tools"}'
zai-cli call zai.search.web_search_prime --json '{"search_query":"LLM tools"}'
```

## Code Mode (TypeScript tool chains)

```bash
zai-cli code run ./chain.ts
zai-cli code eval "await call('zai.search.webSearchPrime', { search_query: 'zai cli' })"
zai-cli code eval "await call('zai.search.web_search_prime', { search_query: 'zai cli' })"
zai-cli code interfaces
```

Expand Down