MCPcopy Index your code
hub / github.com/simstudioai/sim / getToolDisplayTitle

Function getToolDisplayTitle

apps/sim/lib/copilot/tools/tool-display.ts:119–223  ·  view source on GitHub ↗
(name: string, args?: Record<string, unknown>)

Source from the content-addressed store, hash-verified

117 * returns an empty string.
118 */
119export function getToolDisplayTitle(name: string, args?: Record<string, unknown>): string {
120 switch (name) {
121 case 'search_online': {
122 const target = firstStringArg(args, 'toolTitle', 'title')
123 return target ? `Searching online for ${target}` : 'Searching online'
124 }
125 case 'grep': {
126 const target = firstStringArg(args, 'toolTitle', 'title')
127 return target ? `Searching for ${target}` : 'Searching'
128 }
129 case 'glob': {
130 const target = firstStringArg(args, 'toolTitle', 'title')
131 return target ? `Finding ${target}` : 'Finding files'
132 }
133 case 'enrichment_run': {
134 const subject = nestedStringArg(
135 args,
136 'inputs',
137 'fullName',
138 'companyName',
139 'domain',
140 'email',
141 'companyDomain'
142 )
143 return subject ? `Searching for ${subject}` : 'Searching'
144 }
145 case 'scrape_page': {
146 const url = stringArg(args, 'url')
147 return url ? `Scraping ${url}` : 'Scraping page'
148 }
149 case 'crawl_website': {
150 const url = stringArg(args, 'url')
151 return url ? `Crawling ${url}` : 'Crawling website'
152 }
153 case 'get_page_contents': {
154 const urls = stringArrayArg(args, 'urls')
155 if (urls.length === 1) return `Getting ${urls[0]}`
156 if (urls.length > 1) return `Getting ${urls.length} pages`
157 return 'Getting page contents'
158 }
159 case 'manage_custom_tool':
160 return operationTitle(args, 'Custom tool action', {
161 add: 'Creating custom tool',
162 edit: 'Updating custom tool',
163 delete: 'Deleting custom tool',
164 list: 'Listing custom tools',
165 })
166 case 'manage_mcp_tool':
167 return operationTitle(args, 'MCP server action', {
168 add: 'Creating MCP server',
169 edit: 'Updating MCP server',
170 delete: 'Deleting MCP server',
171 list: 'Listing MCP servers',
172 })
173 case 'manage_skill':
174 return operationTitle(args, 'Skill action', {
175 add: 'Creating skill',
176 edit: 'Updating skill',

Callers 4

applyToolDisplayFunction · 0.90
toToolDataFunction · 0.90
resolveToolDisplayTitleFunction · 0.90

Calls 8

firstStringArgFunction · 0.85
nestedStringArgFunction · 0.85
stringArgFunction · 0.85
stringArrayArgFunction · 0.85
operationTitleFunction · 0.85
isWorkflowArtifactPathFunction · 0.85
workspaceFileTitleFunction · 0.85
humanizeToolNameFunction · 0.85

Tested by

no test coverage detected