Skip to main content
Glama

gitea_workflow_init

Initialize issue workflow configuration for Gitea projects by generating .gitea/issue-workflow.yaml with labels, board columns, and automation rules based on project type.

Instructions

Initialize Issue workflow configuration for a project. Generates .gitea/issue-workflow.yaml with labels, board columns, and automation rules based on project type.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerNoRepository owner. Uses context if not provided
repoNoRepository name. Uses context if not provided
project_typeYesProject type for template selection
languageNoPrimary programming language (e.g., go, typescript, python)

Implementation Reference

  • The core handler function `workflowInit` that initializes the Gitea issue workflow by generating a default .gitea/issue-workflow.yaml configuration file based on the project type and optional language. It resolves owner/repo from context, generates config using helpers, serializes to YAML, and returns the content.
    export async function workflowInit( ctx: WorkflowToolsContext, args: { owner?: string; repo?: string; project_type: ProjectType; language?: string; } ): Promise<{ success: boolean; message: string; config_path: string; config_content: string; }> { logger.debug({ args }, 'Initializing workflow config'); const { owner, repo } = ctx.contextManager.resolveOwnerRepo(args.owner, args.repo); // 生成默认配置 const config = generateDefaultConfig(repo, args.project_type, `${owner}/${repo}`, args.language); // 序列化为 YAML const yamlContent = serializeConfig(config); const configPath = '.gitea/issue-workflow.yaml'; logger.info({ owner, repo, project_type: args.project_type }, 'Workflow config generated'); return { success: true, message: `工作流配置已生成,请将以下内容保存到 ${configPath}`, config_path: configPath, config_content: yamlContent, }; }
  • Tool registration for 'gitea_workflow_init' in the MCP server, including title, description, Zod input schema validation, and handler wrapper that calls the workflowInit function from workflow tools.
    mcpServer.registerTool( 'gitea_workflow_init', { title: '初始化工作流配置', description: 'Initialize Issue workflow configuration for a project. Generates .gitea/issue-workflow.yaml with labels, board columns, and automation rules based on project type.', inputSchema: z.object({ owner: z.string().optional().describe('Repository owner. Uses context if not provided'), repo: z.string().optional().describe('Repository name. Uses context if not provided'), project_type: z .enum(['backend', 'frontend', 'fullstack', 'library']) .describe('Project type for template selection'), language: z.string().optional().describe('Primary programming language (e.g., go, typescript, python)'), }), }, async (args) => { try { const result = await WorkflowTools.workflowInit( { client: ctx.client, contextManager: ctx.contextManager }, args ); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }], isError: !result.success, }; } catch (error: unknown) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [{ type: 'text' as const, text: `Error: ${errorMessage}` }], isError: true, }; } } );
  • Zod input schema defining parameters for the tool: optional owner/repo (resolved from context), required project_type enum, optional language.
    inputSchema: z.object({ owner: z.string().optional().describe('Repository owner. Uses context if not provided'), repo: z.string().optional().describe('Repository name. Uses context if not provided'), project_type: z .enum(['backend', 'frontend', 'fullstack', 'library']) .describe('Project type for template selection'), language: z.string().optional().describe('Primary programming language (e.g., go, typescript, python)'), }), },

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/SupenBysz/gitea-mcp-tool'

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