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

Function getPromptForCommand

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

Source from the content-addressed store, hash-verified

2071 argNames,
2072 source: 'mcp',
2073 async getPromptForCommand(args: string) {
2074 const argsArray = args.split(' ')
2075 try {
2076 const connectedClient = await ensureConnectedClient(client)
2077 const result = await connectedClient.client.getPrompt({
2078 name: prompt.name,
2079 arguments: zipObject(argNames, argsArray),
2080 })
2081 const transformed = await Promise.all(
2082 result.messages.map(message =>
2083 transformResultContent(message.content, connectedClient.name),
2084 ),
2085 )
2086 return transformed.flat()
2087 } catch (error) {
2088 logMCPError(
2089 client.name,
2090 `Error running command '${prompt.name}': ${errorMessage(error)}`,
2091 )
2092 throw error
2093 }
2094 },
2095 }
2096 })
2097 } 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