Skip to main content
Glama
Hive-Academy

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

by Hive-Academy

get_workflow_guidance

Generate context-specific workflow guidance tailored to your role and task. Input role and task details to receive precise, project-relevant execution support.

Instructions

Provides minimal role identity and basic capabilities for workflow execution.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathNoProject path for project-specific context
roleNameYesCurrent role name for workflow guidance
taskIdYesTask ID for context-specific guidance

Implementation Reference

  • The primary MCP tool handler for 'get_workflow_guidance'. It processes input, retrieves or creates execution context, ensures current step is assigned, fetches role guidance from the service, and returns structured response with execution context.
    @Tool({
      name: 'get_workflow_guidance',
      description: `Provides minimal role identity and basic capabilities for workflow execution.`,
      parameters:
        GetWorkflowGuidanceInputSchema as ZodSchema<GetWorkflowGuidanceInput>,
    })
    async getWorkflowGuidance(input: GetWorkflowGuidanceInput): Promise<any> {
      try {
        // πŸ”§ BOOTSTRAP FIX: Handle both taskId and executionId
        let currentExecution;
        let contextTaskId: number;
    
        if (input.executionId) {
          // Query by executionId (bootstrap mode)
          currentExecution = await this.workflowExecutionRepository.findById(
            input.executionId,
            {
              currentRole: true,
              currentStep: true,
            },
          );
          contextTaskId = currentExecution?.taskId || 0; // Use 0 for bootstrap mode
        } else if (input.taskId !== undefined) {
          // Query by taskId (normal mode)
          const taskId =
            typeof input.taskId === 'string'
              ? parseInt(input.taskId)
              : input.taskId;
    
          if (isNaN(taskId)) {
            throw new Error(`Invalid taskId: ${input.taskId}`);
          }
    
          currentExecution = await this.workflowExecutionRepository.findByTaskId(
            taskId,
            {
              currentRole: true,
              currentStep: true,
            },
          );
          contextTaskId = taskId;
        } else {
          throw new Error('Either taskId or executionId must be provided');
        }
    
        if (currentExecution) {
          // Check if execution has proper step assignment
          if (!currentExecution.currentStepId) {
            // Try to find and assign the first step for the current role
            const firstStepForRole =
              await this.workflowStepRepository.findFirstStepForRole(
                currentExecution.currentRoleId,
              );
    
            if (firstStepForRole) {
              await this.fixMissingCurrentStep(
                currentExecution,
                firstStepForRole,
              );
            }
          }
        }
    
        const context = {
          taskId: contextTaskId,
          projectPath: input.projectPath,
        };
    
        // Get ONLY essential role identity - NO verbose behavioral context
        // The guidance service now returns minimal role data without relations
        const roleGuidance =
          await this.workflowGuidanceService.getWorkflowGuidance(
            input.roleName,
            context,
          );
    
        // πŸ†• ENHANCEMENT: Include execution context in response
        const executionContext = currentExecution
          ? {
              executionId: currentExecution.id,
              currentStepId: currentExecution.currentStepId,
              executionState: currentExecution.executionState,
              hasCurrentStep: !!currentExecution.currentStepId,
            }
          : null;
    
        // Return minimal essential-only response with execution context
        return this.buildResponse({
          success: true,
          currentRole: roleGuidance.currentRole,
          executionContext: executionContext,
        });
      } catch (error: any) {
        return this.buildErrorResponse(
          'Failed to get workflow guidance',
          error.message,
          'GUIDANCE_ERROR',
        );
      }
    }
  • Zod schema defining the input parameters for the get_workflow_guidance tool, including roleName, taskId/executionId, etc., with validation that at least one of taskId or executionId is provided.
    const GetWorkflowGuidanceInputSchema = z
      .object({
        roleName: z
          .enum(['product-manager', 'architect', 'senior-developer', 'code-review'])
          .describe('Current role name for workflow guidance'),
        taskId: z
          .number()
          .optional()
          .describe('Task ID for context (optional during bootstrap)'),
        roleId: z.string().describe('Role ID for transition context'),
        executionId: z
          .string()
          .optional()
          .describe('Execution ID (alternative to taskId)'),
        projectPath: z
          .string()
          .optional()
          .describe('Project path for project-specific context'),
      })
      .refine(
        (data) => data.taskId !== undefined || data.executionId !== undefined,
        {
          message: 'Either taskId or executionId must be provided',
          path: ['taskId', 'executionId'],
        },
      );
  • Helper service method that fetches the WorkflowRole by name (without relations) and returns minimal role guidance structure. Called by the MCP handler.
    async getWorkflowGuidance(
      roleName: string,
      _context: RoleContext,
    ): Promise<WorkflowGuidance> {
      // Get role information WITHOUT relations to keep response minimal
      // Explicitly pass empty include to avoid loading any relations
      const role = await this.getWorkflowRole(roleName, {});
      if (!role) {
        throw new Error(`Workflow role '${roleName}' not found`);
      }
    
      // FOCUSED: Build role-only guidance structure (NO step details)
      const roleGuidance: WorkflowGuidance = {
        currentRole: role,
      };
    
      return roleGuidance;
    }
  • @Tool decorator registration of the get_workflow_guidance tool with name, description, and input schema.
    @Tool({
      name: 'get_workflow_guidance',
      description: `Provides minimal role identity and basic capabilities for workflow execution.`,
      parameters:
        GetWorkflowGuidanceInputSchema as ZodSchema<GetWorkflowGuidanceInput>,
    })
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'minimal role identity and basic capabilities' but doesn't explain what 'guidance' actually means - whether it returns instructions, next steps, validation rules, or something else. For a tool with no annotations and unclear behavior, this is insufficient disclosure of how the tool actually behaves when invoked.

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 extremely concise - a single sentence with 9 words. While this is efficient, it may be too brief given the complexity suggested by the parameter requirements and sibling tool ecosystem. However, every word does contribute to the limited information provided, so it earns points for efficiency despite under-specification.

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?

For a tool with 3 parameters (2 required), no annotations, no output schema, and many sibling tools in a complex workflow system, the description is inadequate. It doesn't explain what 'guidance' means, what format it returns, how it differs from other guidance tools, or what 'basic capabilities' refers to. The description fails to provide sufficient context for an agent to understand when and how to use this tool effectively.

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?

Schema description coverage is 100%, so the schema already documents all three parameters (projectPath, roleName, taskId) with their types and descriptions. The tool description adds no additional parameter information beyond what's in the schema. With complete schema coverage, the baseline score of 3 is appropriate as the description doesn't need to compensate for schema gaps.

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

Purpose2/5

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

The description states 'Provides minimal role identity and basic capabilities for workflow execution' which is vague and tautological - it essentially restates the tool name 'get_workflow_guidance' without specifying what concrete action it performs. It doesn't clearly distinguish this from sibling tools like 'get_step_guidance' or 'get_role_transitions' that also seem related to workflow guidance.

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?

No guidance is provided about when to use this tool versus alternatives. With many sibling tools related to workflows (bootstrap_workflow, get_step_guidance, get_role_transitions, etc.), the description offers no context about when this specific guidance tool is appropriate versus other guidance or execution tools in the workflow system.

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