File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
microsoft365/excel-mcp-go Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import (
1919 "github.com/google/jsonschema-go/jsonschema"
2020 "github.com/microsoft/kiota-abstractions-go/serialization"
2121 msgraphsdkgo "github.com/microsoftgraph/msgraph-sdk-go"
22+ "github.com/microsoftgraph/msgraph-sdk-go/drives"
2223 "github.com/microsoftgraph/msgraph-sdk-go/models"
2324 "github.com/modelcontextprotocol/go-sdk/mcp"
2425 util "github.com/obot-platform/tools/microsoft365/excel-mcp-go/utils"
@@ -583,9 +584,12 @@ func (e *ExcelMCPServer) CreateWorksheet(ctx context.Context, req *mcp.CallToolR
583584 return nil , nil , fmt .Errorf ("failed to retrieve user's drive ID" )
584585 }
585586
587+ requestBody := drives .NewItemItemsItemWorkbookWorksheetsAddPostRequestBody ()
588+ requestBody .SetName (util .Ptr (args .Name ))
589+
586590 // Create new worksheet
587591 _ , err = e .client .Drives ().ByDriveId (* drive .GetId ()).Items ().ByDriveItemId (args .WorkbookID ).
588- Workbook ().Worksheets ().Post (ctx , nil , nil )
592+ Workbook ().Worksheets ().Add (). Post (ctx , requestBody , nil )
589593 if err != nil {
590594 return nil , nil , fmt .Errorf ("failed to create worksheet: %w" , err )
591595 }
You can’t perform that action at this time.
0 commit comments