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

Function deleteSkill

apps/sim/lib/workflows/skills/operations.ts:81–102  ·  view source on GitHub ↗
(params: {
  skillId: string
  workspaceId: string
})

Source from the content-addressed store, hash-verified

79 * Returns true if the skill was found and deleted, false otherwise.
80 */
81export async function deleteSkill(params: {
82 skillId: string
83 workspaceId: string
84}): Promise<boolean> {
85 // Built-in template skills have no DB row and cannot be deleted.
86 if (isBuiltinSkillId(params.skillId)) return false
87
88 const existing = await db
89 .select({ id: skill.id })
90 .from(skill)
91 .where(and(eq(skill.id, params.skillId), eq(skill.workspaceId, params.workspaceId)))
92 .limit(1)
93
94 if (existing.length === 0) return false
95
96 await db
97 .delete(skill)
98 .where(and(eq(skill.id, params.skillId), eq(skill.workspaceId, params.workspaceId)))
99
100 logger.info(`Deleted skill ${params.skillId}`)
101 return true
102}
103
104/** Whether a given skill in an upsert was newly inserted or an existing row updated. */
105export type SkillUpsertOperation = 'created' | 'updated'

Callers 2

executeManageSkillFunction · 0.90
route.tsFile · 0.90

Calls 4

isBuiltinSkillIdFunction · 0.90
infoMethod · 0.80
deleteMethod · 0.65
eqFunction · 0.50

Tested by

no test coverage detected