MCPcopy Create free account
hub / github.com/modelscope/ms-agent / validate_skill_schema

Method validate_skill_schema

ms_agent/skill/schema.py:321–354  ·  view source on GitHub ↗

Validate a Skill schema and return list of errors. Args: schema: SkillSchema to validate Returns: List of error messages (empty if valid)

(schema: SkillSchema)

Source from the content-addressed store, hash-verified

319
320 @staticmethod
321 def validate_skill_schema(schema: SkillSchema) -> List[str]:
322 """
323 Validate a Skill schema and return list of errors.
324
325 Args:
326 schema: SkillSchema to validate
327
328 Returns:
329 List of error messages (empty if valid)
330 """
331 errors = []
332
333 # Check skill_id
334 if not schema.skill_id:
335 errors.append('Skill ID is required')
336
337 # Check name length
338 if len(schema.name) > 64:
339 errors.append('Skill name exceeds 64 characters')
340
341 # Check description length
342 if len(schema.description) > 1024:
343 errors.append('Skill description exceeds 1024 characters')
344
345 # Check SKILL.md exists
346 has_skill_md = any(f.name == 'SKILL.md' for f in schema.files)
347 if not has_skill_md:
348 errors.append('SKILL.md is required')
349
350 # Check directory exists
351 if not schema.skill_path.exists():
352 errors.append(f'Directory does not exist: {schema.skill_path}')
353
354 return errors
355
356
357@dataclass

Callers 1

_load_single_skillMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected