Files
ragflow/web/src/pages/agent/hooks/use-is-mcp.ts
Jimmy Ben Klieve 47005ebe10 feat: supports multiple retrieval tool under an agent (#12046)
### What problem does this PR solve?

Add support for multiple Retrieval tools under an agent

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
2025-12-22 09:35:34 +08:00

14 lines
386 B
TypeScript

import { Operator } from '../constant';
import useGraphStore from '../store';
export function useIsMcp(operatorName: Operator) {
const { clickedToolId, getAgentToolById } = useGraphStore();
const { component_name: toolName } = getAgentToolById(clickedToolId) ?? {};
return (
operatorName === Operator.Tool &&
Object.values(Operator).every((x) => x !== toolName)
);
}