Skip to content
Merged
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
6 changes: 0 additions & 6 deletions src/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,3 @@ export const DEFAULT_BASE_URL = 'https://api.stackone.com';
* - Higher values favor TF-IDF scoring (better semantic matching)
*/
export const DEFAULT_HYBRID_ALPHA = 0.2;

/**
* Prefix used by legacy Unified API tools.
* Tools with this prefix indicate missing or incorrect account configuration.
*/
export const UNIFIED_API_PREFIX = 'unified_';
1 change: 0 additions & 1 deletion src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ const rpcActionResponseDataSchema = z.union([
* - `next`: Pagination cursor for fetching next page
*
* Additional fields from the connector response are passed through.
* @see unified-cloud-api/src/unified-api-v2/unifiedAPIv2.service.ts processActionCall
*/
export const rpcActionResponseSchema = z.looseObject({
next: z.nullable(z.optional(z.string())),
Expand Down
30 changes: 0 additions & 30 deletions src/toolsets.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,36 +250,6 @@ describe('StackOneToolSet', () => {
const executableTool = (await tool?.toAISDK())?.dummy_action;
expect(executableTool?.execute).toBeDefined();
});

it('throws error when receiving unified API tools', async () => {
const unifiedToolMcpApp = createMcpApp({
accountTools: {
'unified-test-account': [
{
name: 'unified_hris_list_employees',
description: 'Unified HRIS tool',
inputSchema: { type: 'object', properties: {} },
},
],
},
});

server.use(
http.all('https://api.stackone-dev.com/mcp', async ({ request }) => {
return unifiedToolMcpApp.fetch(request);
}),
);

const toolset = new StackOneToolSet({
baseUrl: 'https://api.stackone-dev.com',
apiKey: 'test-key',
accountId: 'unified-test-account',
});

await expect(toolset.fetchTools()).rejects.toThrow(ToolSetConfigError);
await expect(toolset.fetchTools()).rejects.toThrow(/unified API tool/);
await expect(toolset.fetchTools()).rejects.toThrow(/unified_hris_list_employees/);
});
});

describe('account filtering', () => {
Expand Down
17 changes: 1 addition & 16 deletions src/toolsets.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defu } from 'defu';
import type { MergeExclusive, SimplifyDeep } from 'type-fest';
import { DEFAULT_BASE_URL, UNIFIED_API_PREFIX } from './consts';
import { DEFAULT_BASE_URL } from './consts';
import { createFeedbackTool } from './feedback';
import { type StackOneHeaders, normalizeHeaders, stackOneHeadersSchema } from './headers';
import { createMCPClient } from './mcp-client';
Expand Down Expand Up @@ -313,19 +313,6 @@ export class StackOneToolSet {
return toolsWithFeedback;
}

/**
* Validate that tool name is not from unified API
* Unified API tools indicate missing or incorrect account configuration
*/
private validateToolName(toolName: string): void {
if (toolName.startsWith(UNIFIED_API_PREFIX)) {
throw new ToolSetConfigError(
`Received unified API tool "${toolName}". This indicates the account is not properly configured. ` +
`Unified API tools require versioned connectors. Please check your account's integration setup.`,
);
}
}

/**
* Fetch tool definitions from MCP
*/
Expand All @@ -344,8 +331,6 @@ export class StackOneToolSet {
const actionsClient = this.getActionsClient();

const tools = listToolsResult.tools.map(({ name, description, inputSchema }) => {
this.validateToolName(name);

return this.createRpcBackedTool({
actionsClient,
name,
Expand Down
Loading