Skip to main content
Glama
Hive-Academy

π“‚€π“’π“‹Ήπ”Έβ„•π•Œπ”Ήπ•€π•Šπ“‹Ήπ“’π“‚€ - Intelligent Guidance for

by Hive-Academy

validate_transition

Checks role transition compliance by validating requirements and providing pass/fail status with actionable feedback for role and task contexts.

Instructions

Validates role transition requirements and provides pass/fail status with actionable feedback.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
roleIdYesRole ID for validation context
taskIdYesTask ID for validation context
transitionIdYesTransition ID to validate

Implementation Reference

  • MCP tool handler function that executes the validate_transition logic, builds context, calls service, and formats response.
    async validateTransition(input: ValidateTransitionInput) {
      try {
        const context = {
          taskId: input.taskId.toString(),
          roleId: input.roleId,
        };
    
        const validation = await this.roleTransitionService.validateTransition(
          input.transitionId,
          context,
        );
    
        // βœ… MINIMAL RESPONSE: Only essential validation data
        return this.buildResponse({
          transitionId: input.transitionId,
          valid: validation.valid,
          status: validation.valid ? 'passed' : 'failed',
          issues: validation.errors || [],
          warnings: validation.warnings || [],
        });
      } catch (error) {
        return this.buildErrorResponse(
          'Failed to validate transition',
          getErrorMessage(error),
          'VALIDATION_ERROR',
        );
      }
  • Zod input schema for the validate_transition tool defining required parameters.
    const ValidateTransitionInputSchema = z.object({
      transitionId: z.string().describe('Transition ID to validate'),
      taskId: z.number().describe('Task ID for validation context'),
      roleId: z.string().describe('Role ID for validation context'),
    });
  • Registration of the validate_transition tool via @Tool decorator specifying name, description, and schema.
    @Tool({
      name: 'validate_transition',
      description: `Validates role transition requirements and provides pass/fail status with actionable feedback.`,
      parameters:
        ValidateTransitionInputSchema as ZodSchema<ValidateTransitionInput>,
    })
  • Core helper function in RoleTransitionService that performs the actual transition validation by checking conditions against database and context.
    async validateTransition(
      transitionId: string,
      context: { roleId: string; taskId: string; projectPath?: string },
    ): Promise<TransitionValidationResult> {
      try {
        const transition =
          await this.workflowRoleRepository.findTransitionById(transitionId);
    
        if (!transition) {
          return { valid: false, errors: ['Transition not found'] };
        }
    
        const errors: string[] = [];
        const warnings: string[] = [];
    
        // Validate transition conditions using structured data
        if (
          transition.conditions &&
          (transition.conditions as { name: string; value: boolean }[]).length > 0
        ) {
          const conditionResult =
            await this.validateStructuredTransitionConditions(
              transition.conditions as { name: string; value: boolean }[],
              context,
            );
          if (!conditionResult.valid) {
            errors.push(...conditionResult.errors);
          }
          if (conditionResult.warnings) {
            warnings.push(...conditionResult.warnings);
          }
        }
    
        return {
          valid: errors.length === 0,
          errors,
          warnings: warnings.length > 0 ? warnings : undefined,
        };
      } catch (error) {
        return {
          valid: false,
          errors: [`Validation error: ${error.message}`],
        };
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the tool provides 'pass/fail status with actionable feedback', which hints at read-only behavior, but doesn't clarify if this is a safe operation, whether it requires specific permissions, or if it has side effects like logging. For a validation tool with zero annotation coverage, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose. There's no wasted verbiage, and it directly communicates the tool's function and output. However, it could be slightly more structured by separating purpose from output details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity implied by validating role transitions and the lack of annotations and output schema, the description is incomplete. It doesn't explain what constitutes a valid transition, the format of the feedback, or error handling. For a tool with three required parameters and no structured output, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with all three parameters clearly documented in the schema. The description adds no additional semantic context about the parameters beyond what's in the schema (e.g., how roleId, taskId, and transitionId interrelate). This meets the baseline score of 3 since the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('validates') and resource ('role transition requirements'), and specifies the output ('pass/fail status with actionable feedback'). However, it doesn't explicitly distinguish this validation tool from sibling tools like 'get_role_transitions' or 'execute_transition', which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With multiple sibling tools related to transitions and workflows (e.g., 'execute_transition', 'get_role_transitions'), there's no indication of prerequisites, timing, or comparative use cases. This leaves significant ambiguity for an agent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Hive-Academy/Anubis-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server