Skip to main content
Glama
esign-cn-open-source

e签宝 MCP Server

Official

query_sign_flow

Retrieve detailed status and progress information for electronic signature workflows using the flow ID.

Instructions

Query sign flow details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
flowIdYesSign flow ID

Implementation Reference

  • Main handler for 'query_sign_flow' tool in the CallToolRequestSchema switch statement. Extracts flowId, calls getSignFlowDetail, formats status and times, and returns formatted details or error.
            case "query_sign_flow": {
                try {
                    const args = request.params.arguments as { flowId: string };
                    const detail = await getSignFlowDetail(args.flowId);
    
                    const statusMap: Record<number, string> = {
                        0: "草稿",
                        1: "签署中",
                        2: "完成",
                        3: "撤销",
                        5: "过期",
                        7: "拒签"
                    };
    
                    const formatTime = (timestamp: number | null) => {
                        if (!timestamp) return "未完成";
                        return new Date(timestamp).toLocaleString();
                    };
    
                    return {
                        content: [{
                            type: "text",
                            text: `签署流程详情:
    状态:${statusMap[detail.signFlowStatus] || "未知"} (${detail.signFlowDescription})
    创建时间:${formatTime(detail.signFlowCreateTime)}
    开始时间:${formatTime(detail.signFlowStartTime)}
    完成时间:${formatTime(detail.signFlowFinishTime)}
    文档:${detail.docs.map(doc => doc.fileName).join(", ")}
    签署人:${detail.signers.map(signer =>
                                signer.psnSigner ?
                                    `${signer.psnSigner.psnName} (${signer.psnSigner.psnAccount.accountMobile})` :
                                    "企业签署"
                            ).join(", ")}`
                        }]
                    };
                } catch (err: any) {
                    return {
                        content: [{
                            type: "text",
                            text: `Error: ${err.message}`
                        }]
                    };
                }
            }
  • Input schema definition for 'query_sign_flow' tool, requiring 'flowId' string.
    name: "query_sign_flow",
    description: "Query sign flow details",
    inputSchema: {
        type: "object",
        properties: {
            flowId: {
                type: "string",
                description: "Sign flow ID"
            }
        },
        required: ["flowId"]
    }
  • src/index.ts:188-201 (registration)
    Tool registration in ListToolsRequestSchema response, defining name, description, and input schema.
    {
        name: "query_sign_flow",
        description: "Query sign flow details",
        inputSchema: {
            type: "object",
            properties: {
                flowId: {
                    type: "string",
                    description: "Sign flow ID"
                }
            },
            required: ["flowId"]
        }
    }
  • Helper function that queries the eSign API for sign flow details using the provided flowId.
    async function getSignFlowDetail(flowId: string): Promise<SignFlowDetailResponse> {
        const requestPath = `/v3/sign-flow/${flowId}/detail`;
        const headers = getCommonHeaders('GET', requestPath, 'application/json; charset=UTF-8');
    
        const response = await fetch(`${config.host}${requestPath}`, {
            method: 'GET',
            headers: headers
        });
    
        const result = await response.json() as ApiResponse<SignFlowDetailResponse>;
        if (result.code === 0) {
            return result.data;
        }
        throw new Error(`Failed to get sign flow detail: ${result.message}`);
    }
  • TypeScript interface defining the structure of the sign flow detail response from the API.
    interface SignFlowDetailResponse {
        signFlowStatus: number;
        signFlowDescription: string;
        signFlowCreateTime: number;
        signFlowStartTime: number;
        signFlowFinishTime: number | null;
        docs: Array<{
            fileId: string;
            fileName: string;
        }>;
        signers: Array<{
            psnSigner?: {
                psnName: string;
                psnAccount: {
                    accountMobile: string;
                    accountEmail: string | null;
                };
            };
            signerType: number;
            signOrder: number;
            signStatus: number;
        }>;
    }
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. The description only states it queries details, which implies a read operation, but doesn't disclose any behavioral traits such as authentication requirements, rate limits, error conditions, or what format/details are returned. For a tool with zero annotation coverage, this is insufficient.

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 with just three words, which is appropriately sized for a simple query tool. It's front-loaded with the core action ('Query'), but could benefit from slightly more detail to improve clarity without sacrificing brevity. There's no wasted language.

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 tool's simplicity (1 parameter, 100% schema coverage, no output schema), the description is incomplete. It doesn't explain what 'sign flow' refers to, what details are returned, or any behavioral aspects. With no annotations and no output schema, the description should provide more context to be fully helpful to an AI agent.

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 input schema has 100% description coverage (the 'flowId' parameter is documented as 'Sign flow ID'), so the baseline score is 3. The description adds no additional meaning about parameters beyond what the schema already provides—it doesn't explain what a 'sign flow' is, how to obtain the ID, or any constraints on the ID format.

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

Purpose3/5

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

The description 'Query sign flow details' states a general purpose (querying details about sign flows) but lacks specificity about what 'details' means or what resource is being queried. It distinguishes from the sibling 'create_sign_flow' by using 'query' vs 'create', but doesn't clarify what distinguishes it beyond the basic verb difference. The purpose is vague but not tautological or misleading.

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. It doesn't mention prerequisites, context for usage, or any exclusions. The only implied usage is that it's for querying rather than creating (based on sibling name), but this is not explicitly stated in the description itself.

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

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/esign-cn-open-source/mcp-server-esign'

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