MCPcopy
hub / github.com/claude-code-best/claude-code / getPromptForCommand

Function getPromptForCommand

src/services/mcp/client.ts:2085–2106  ·  view source on GitHub ↗
(args: string)

Source from the content-addressed store, hash-verified

2083 argNames,
2084 source: 'mcp',
2085 async getPromptForCommand(args: string) {
2086 const argsArray = args.split(' ')
2087 try {
2088 const connectedClient = await ensureConnectedClient(client)
2089 const result = await connectedClient.client.getPrompt({
2090 name: prompt.name,
2091 arguments: zipObject(argNames, argsArray),
2092 })
2093 const transformed = await Promise.all(
2094 result.messages.map(message =>
2095 transformResultContent(message.content, connectedClient.name),
2096 ),
2097 )
2098 return transformed.flat()
2099 } catch (error) {
2100 logMCPError(
2101 client.name,
2102 `Error running command '${prompt.name}': ${errorMessage(error)}`,
2103 )
2104 throw error
2105 }
2106 },
2107 }
2108 })
2109 } catch (error) {

Callers

nothing calls this directly

Calls 4

ensureConnectedClientFunction · 0.85
transformResultContentFunction · 0.85
logMCPErrorFunction · 0.85
errorMessageFunction · 0.50

Tested by

no test coverage detected