Skip to content

Commit cc0f680

Browse files
committed
resolve PR comments
1 parent be58caa commit cc0f680

17 files changed

Lines changed: 202 additions & 54 deletions

File tree

apps/sim/app/api/mcp/servers/[id]/refresh/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const POST = withMcpAuth('read')(
5555
let lastError: string | null = null
5656

5757
try {
58-
const tools = await mcpService.discoverServerTools(userId, serverId, workspaceId, true) // Force refresh
58+
const tools = await mcpService.discoverServerTools(userId, serverId, workspaceId)
5959
connectionStatus = 'connected'
6060
toolCount = tools.length
6161
logger.info(

apps/sim/app/api/mcp/tools/discover/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const GET = withMcpAuth('read')(
2727

2828
let tools
2929
if (serverId) {
30-
tools = await mcpService.discoverServerTools(userId, serverId, workspaceId, forceRefresh)
30+
tools = await mcpService.discoverServerTools(userId, serverId, workspaceId)
3131
} else {
3232
tools = await mcpService.discoverTools(userId, workspaceId, forceRefresh)
3333
}
@@ -79,7 +79,7 @@ export const POST = withMcpAuth('read')(
7979

8080
const results = await Promise.allSettled(
8181
serverIds.map(async (serverId: string) => {
82-
const tools = await mcpService.discoverServerTools(userId, serverId, workspaceId, true)
82+
const tools = await mcpService.discoverServerTools(userId, serverId, workspaceId)
8383
return { serverId, toolCount: tools.length }
8484
})
8585
)

apps/sim/app/api/mcp/tools/execute/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const POST = withMcpAuth('read')(
5454

5555
let tool = null
5656
try {
57-
const tools = await mcpService.discoverServerTools(userId, serverId, workspaceId, false) // Use cache
57+
const tools = await mcpService.discoverServerTools(userId, serverId, workspaceId)
5858
tool = tools.find((t) => t.name === toolName)
5959

6060
if (!tool) {

apps/sim/app/api/tools/google_calendar/calendars/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ interface CalendarListItem {
2121
* Get calendars from Google Calendar
2222
*/
2323
export async function GET(request: NextRequest) {
24-
const requestId = generateRequestId() // Generate a short request ID for correlation
24+
const requestId = generateRequestId()
2525
logger.info(`[${requestId}] Google Calendar calendars request received`)
2626

2727
try {

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/components/mcp-dynamic-args/mcp-dynamic-args.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,15 @@ export function McpDynamicArgs({
3232

3333
const currentArgs = useCallback(() => {
3434
if (isPreview && previewValue) {
35-
return typeof previewValue === 'string' ? JSON.parse(previewValue) : previewValue
35+
if (typeof previewValue === 'string') {
36+
try {
37+
return JSON.parse(previewValue)
38+
} catch (error) {
39+
console.warn('Failed to parse preview value as JSON:', error)
40+
return previewValue
41+
}
42+
}
43+
return previewValue
3644
}
3745
if (typeof toolArgs === 'string') {
3846
try {

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/components/mcp-server-modal/mcp-tool-selector.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,10 @@ import {
1313
CommandList,
1414
} from '@/components/ui/command'
1515
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'
16-
import { createLogger } from '@/lib/logs/console/logger'
1716
import { useSubBlockValue } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/hooks/use-sub-block-value'
1817
import type { SubBlockConfig } from '@/blocks/types'
1918
import { useMcpTools } from '@/hooks/use-mcp-tools'
2019

21-
const logger = createLogger('McpToolSelector')
22-
2320
interface McpToolSelectorProps {
2421
blockId: string
2522
subBlock: SubBlockConfig

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/mcp/mcp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ export function MCP() {
743743
<SelectValue />
744744
</SelectTrigger>
745745
<SelectContent>
746-
<SelectItem value='streamable-http'>Streamable HTTP </SelectItem>
746+
<SelectItem value='streamable-http'>Streamable HTTP</SelectItem>
747747
<SelectItem value='http'>HTTP</SelectItem>
748748
<SelectItem value='sse'>Server-Sent Events</SelectItem>
749749
</SelectContent>
File renamed without changes.

apps/sim/db/migrations/meta/0087_snapshot.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"id": "abef926f-8dce-4a71-93f9-16a87f3020f9",
2+
"id": "2091645c-e3df-44b6-9c7f-8e066741b51e",
33
"prevId": "ef439418-5e82-4e59-9013-8b116258d511",
44
"version": "7",
55
"dialect": "postgresql",

apps/sim/db/migrations/meta/_journal.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,8 +607,8 @@
607607
{
608608
"idx": 87,
609609
"version": "7",
610-
"when": 1757444334787,
611-
"tag": "0087_brief_gargoyle",
610+
"when": 1757448419436,
611+
"tag": "0087_wealthy_landau",
612612
"breakpoints": true
613613
}
614614
]

0 commit comments

Comments
 (0)