MCPcopy Create free account
hub / github.com/codeaashu/claude-code / extractSkillName

Function extractSkillName

src/services/analytics/metadata.ts:215–234  ·  view source on GitHub ↗
(
  toolName: string,
  input: unknown,
)

Source from the content-addressed store, hash-verified

213 * @returns The skill name if this is a Skill tool call, undefined otherwise
214 */
215export function extractSkillName(
216 toolName: string,
217 input: unknown,
218): AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS | undefined {
219 if (toolName !== 'Skill') {
220 return undefined
221 }
222
223 if (
224 typeof input === 'object' &&
225 input !== null &&
226 'skill' in input &&
227 typeof (input as { skill: unknown }).skill === 'string'
228 ) {
229 return (input as { skill: string })
230 .skill as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS
231 }
232
233 return undefined
234}
235
236const TOOL_INPUT_STRING_TRUNCATE_AT = 512
237const TOOL_INPUT_STRING_TRUNCATE_TO = 128

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected